Newb Posted May 4, 2011 Posted May 4, 2011 (edited) I am trying to select the various radio buttons in this webpage which creates automated workouts to follow during the week. I have already stumbled upon selecting things in a guy and even in a webpage, but this time I am not able to do it, don't know why... Couald anyone help me to do a working selection code? #include <ie.au3> Global $oIe=_IECreate("C:/Agym.php.htm") $oForm = _IEFormGetCollection ($oIE,1) $Selection32=_IEFormElementGetCollection($oForm,0) _IEFormElementRadioSelect($Selection32,'Running',"stat",1,"byValue") This is what i tried but no luck I tried to mess up also with _IEFormGetObjByName and _IEFormElementGetValue but got nowhere near to it. Thanks.Agym.php.htm Edited May 4, 2011 by Newb I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.
wakillon Posted May 4, 2011 Posted May 4, 2011 When _IEFormElementCheckBoxSelect doesn't work, try _IEAction ! #include <Ie.au3> $sURL = "file:///" & @DesktopDir & "\Agym.php.htm" $oIE= _IECreate ( $sURL ) $oForms = _IEFormGetCollection ( $oIE ) For $oForm In $oForms ConsoleWrite ( "->--- Form name : " & $oForm.name & " Form method : " & $oForm.method & " Form action : " & $oForm.action & @CRLF ) $index = 0 $oFormElements = _IEFormElementGetCollection ( $oForm ) For $oFormElement In $oFormElements ConsoleWrite ( "+>--- FormElement Index : " & $index & " FormElement Name : " & $oFormElement.name & " FormElement Type : " & $oFormElement.type & " FormElement Id : " & $oFormElement.Id & @CRLF ) If $oFormElement.name = 'stat' And $index = 1 Then _IEAction ( $oFormElement, "Click" ) ConsoleWrite ( '!->-- $oFormElement.name : ' & $oFormElement.name & @Crlf ) EndIf $index += 1 Next Next AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Newb Posted May 4, 2011 Author Posted May 4, 2011 (edited) Thanks, it will be very useful also for future uses. A clever way to use it, didn't knew it was possible to use _IeAction like this! Edited May 4, 2011 by Newb I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.
wakillon Posted May 5, 2011 Posted May 5, 2011 (edited) Thanks, it will be very useful also for future uses. A clever way to use it, didn't knew it was possible to use _IeAction like this!When you manually select a checkbox, you need to click it, so _IEAction can replace easily this action ! Edited May 5, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Newb Posted May 5, 2011 Author Posted May 5, 2011 When you manually select a checkbox, you need to click it, so _IEAction can replace easily this action ! Yes, i Just didn't know that exploring forms with GetCollection and similars was actually selecting the elements, and that you just needed to click it. I thought that GetCollection or similar just scan the document for forms. I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.
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