andomatic Posted November 3, 2010 Posted November 3, 2010 Hi, I am very new to autoit, please forgive what I suspect is a simple questiopn... Given this code: $oIE = _IECreate ("http://www.example.com"); some example site with a form on it $oForm = _IEFormGetCollection ($oIE, 0) how can I loop through the collection so as to figure out what to use in _IEFormElementGetCollection so that I hit the correct input box? I am having trouble getting anything to fill in, I've started at zero and worked my way to 15 on the second parameter in _IEFormElementGetCollection. Thanks in advance. Ando
PsaltyDS Posted November 3, 2010 Posted November 3, 2010 Get them all with the default index of -1, then just use a For/In/Next loop to walk through them: $colForms = _IEFormGetCollection($oIE) ; -1 is the default index For $oForm In $colForms ; ... do stuff here with $oForm Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
wakillon Posted November 3, 2010 Posted November 3, 2010 (edited) Welcolme to the forum ! Try this it can help you to find the good way...#include <IE.au3> $Url='http://www.youtube.com/music' $oIE = _IECreate ( $Url, 0, 0, 1 ) $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 ) $index += 1 Next Next _IEQuit ( $oIE ) Edited November 4, 2010 by wakillon AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
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