IE.au3 find all inputs on the webpage

2 posts in this topic

#1 ·  Posted (edited)


I am learning IE.au3 and I struggle with this script

;this script look for input or textarea element which is not type button,hidden,reset or submit and fill with some text
$sURL = ""
;$sURL = "" does not find any input
$oIE = _IECreate($sURL)

$colForms = _IEFormGetCollection($oIE)
For $oForm In $colForms
    ConsoleWrite("---- FORM " & $ & " --------------------" & @CRLF)
    $oFormElements = _IEFormElementGetCollection($oForm) ; get all elements
    For $oFormElement In $oFormElements ; loop over element collection
        If StringInStr("input,textarea", $oFormElement.tagName) Then ; it is an input or textarea
            If StringInStr("button,hidden,reset,submit", $oFormElement.type) Then ContinueLoop ; skip to next entry if type is button,hidden,reset,submit (file,password?)
            ConsoleWrite("> input." & $oFormElement.type & " " & $ & @CRLF)
            _IEFormElementSetValue($oFormElement, "Found You", 0) ; set value of the field

it does work for "" but it does not for "", any idea?


Edited by maniootek

Share this post

Link to post
Share on other sites

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now