Jump to content

How to click button no id or name IE.au3


Recommended Posts

Just now, rm4453 said:
;===CREDIT===========================
;
; URL TO SOURCE: https://www.autoitscript.com/forum/topic/136542-ie-automation-get-all-input-fields-and-set-values/
; CREDIT FOR CODE TO: Robjong
;
;====================================


#include<IE.au3>


$sURL = "http://yahoo.com"
$oIE = _IECreate($sURL, 0, 1, 1, 1)

$colForms = _IEFormGetCollection($oIE) ; get all forms
For $oForm In $colForms ; loop over form collection

    ConsoleWrite("---- FORM " & $oForm.name & " --------------------" & @CRLF)
    $oFormElements = _IEFormElementGetCollection($oForm) ; get all elements
    For $oFormElement In $oFormElements ; loop over element collection

        If StringLower($oFormElement.tagName) == 'input' Then ; it is an input
            ConsoleWrite("> input." & $oFormElement.type & " " & $oFormElement.name & @CRLF)
            _IEFormElementSetValue($oFormElement, "Found You", 0) ; set value of the field
        ElseIf StringLower($oFormElement.tagName) == 'textarea' Then ; it is a textarea
            ConsoleWrite("> textarea " & $oFormElement.name & @CRLF)
            _IEFormElementSetValue($oFormElement, "Found You", 0) ; set value of the field
        EndIf

    Next

Next

 

input.text 62896125e9c95cimage.png.5240bd8f07e65f066df0c6a332204ad8.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...