johannes2 Posted August 2, 2018 Posted August 2, 2018 Hello. First I am getting the window handle: Local $sText = WinGetHandle("[ACTIVE]") This works as intended and returns the correct handle. But this window's only content is a html webpage. I want to access the buttons on this webpage. I have tried getting the buttons with following command: Local $oInputs = _IETagNameGetCollection($sText, "div") After execution pf this line $oInputs has the value 0. What's the correct way to get the button? Note: I have used the window info tool to get some values for you to help me: Window: Class: IEFrame Control: Class: Internet Explorer_Server Instance: 1 Thanks in advance! Johannes
johannes2 Posted August 2, 2018 Author Posted August 2, 2018 I found the solution to the problem myself. But I ran into another problem. Here's the code: Local $aIE[1] $aIE[0] = 0 Local $i = 1, $oIE2 While 1 $oIE2 = _IEAttach("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ReDim $aIE[$i + 1] $aIE[$i] = $oIE2 $aIE[0] = $i $i += 1 if(StringRegExp(_IEPropertyGet($oIE2,"title"),"verifyWindow")) Then $oInputs = _IETagNameGetCollection($oIE2, "button") ExitLoop EndIf WEnd For $oInput In $oInputs _IEAction($oInput, "click") Sleep(2000) ExitLoop Next The for at the bottom only clicks the first button on the page and not the one I want. How can I click a button with no name/class/id and only a text? In DOM it look the following: <button>Verify</button>
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now