Jump to content

IE.au3 find all inputs on the webpage

Recommended Posts



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 = "www.google.com"
;$sURL = "web.airdroid.com" does not find any input
$oIE = _IECreate($sURL)

$colForms = _IEFormGetCollection($oIE)
For $oForm In $colForms
    ConsoleWrite("---- FORM " & $oForm.name & " --------------------" & @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 & " " & $oFormElement.name & @CRLF)
            _IEFormElementSetValue($oFormElement, "Found You", 0) ; set value of the field

it does work for "www.google.com" but it does not for "web.airdroid.com", any idea?


Edited by maniootek

Share this post

Link to post
Share on other sites

Hello. Search by Class.



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