Jump to content

Click to button without ID, Name, Value


Recommended Posts

Hi all, please help me click to this button with IE of AutoIT
Code:
 

<button type="button" class="btn btn-success">Convert</button>

My code:
 

#include <IE.au3>
Local $oButtons = _IETagNameGetCollection($oIE, "button")
Local $sTxt = ""
For $oButton In $oButtons
    $sTxt &= $oButton.type & @CRLF
Next
  If $sTxt == "button" Then _IEAction ($sTxt, "click")

Cheers!

Link to comment
Share on other sites

Try something like:

#include <IE.au3>
Local $oButtons = _IETagNameGetCollection($oIE, "button")
For $oButton In $oButtons
    If $oButton.classname = "btn btn-success" Then
        _IEAction($oButton, "click")
        ExitLoop
    EndIf
;~ Or you could use InnerText
    If $oButton.InnerText = "Convert" Then
        _IEAction($oButton, "click")
        ExitLoop
    EndIf
Next

 

Link to comment
Share on other sites

Not sure you understand my previous question, do both buttons say "Convert" or are they different?  If they are different then you can just use:

#include <IE.au3>
Local $oButtons = _IETagNameGetCollection($oIE, "button")
For $oButton In $oButtons
    If $oButton.InnerText = "Convert" Then
        _IEAction($oButton, "click")
        ExitLoop
    EndIf
Next

 

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...