Jump to content

Click button in Internet Explorer


Recommended Posts

Hey.

How i can release click on button in Autoit.

Html code:

...
<div class="actions">
<button class="button" type="button" onclick="Building.build(10000001, 14, '30');">
<center>Build</center>
</button>
</div>
...

This don't worked:

$oButtons = _IETagNameGetCollection($oIE, 'button')
For $oButton In $oButtons
    If $oButton.classname == 'button' And $oButton.innertext == 'Build' Then
        _IEAction($oButton, 'click')
        _IELoadWait($oIE)
    EndIf
Next

And this not worked:

#include <IE.au3>
$oDivs=_IETagNameGetCollection($oIE, 'div')
If Not @error Then
    For $oDiv In $oDivs
        $sPropDiv=_IEPropertyGet($oDiv, 'outerhtml')
        If Not @error Then
            If StringInStr($sPropDiv, 'button') And StringInStr($sPropDiv, 'Build') Then
                _IEAction($oDiv, 'click')
                ExitLoop
            EndIf
        EndIf
    Next
EndIf

;~ 2 variant,
$oBtns=_IETagNameGetCollection($oIE, 'button')
If Not @error Then
    For $oBtn In $oBtns
        $sPropBtn=_IEPropertyGet($oBtn, 'outerhtml')
        If Not @error Then
            If StringInStr($sPropBtn, 'button') And StringInStr($sPropBtn, 'Build') Then
                _IEAction($oBtn, 'click')
                ExitLoop
            EndIf
        EndIf
    Next
EndIf

Please help

Edited by systel
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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