ArturAker Posted December 10, 2010 Share Posted December 10, 2010 Hi, Im trynig to fill a user name and pass to a form by using the tamplet below: _____________________________________________________________________________________________________________ #include <IE.au3> $oIE = _IECreate ("http://www.someaddress.com") ; get pointers to the login form and username, password and signin fields $o_form = _IEFormGetObjByName ($oIE, "f1") $o_login = _IEFormElementGetObjByName ($o_form, "login") $o_password = _IEFormElementGetObjByName ($o_form, "passwd") $o_signin = _IEFormElementGetObjByName ($o_form, "SI") $username = "your username here" $password = "your password here" ; Set field values and submit the form _IEFormElementSetValue ($o_login, $username) _IEFormElementSetValue ($o_password, $password) _IEAction ($o_signin, "click") ______________________________________________________________________________________________ the problem is that the form has no name value, how can I bypass that issue??? Link to comment Share on other sites More sharing options...
MrMitchell Posted December 10, 2010 Share Posted December 10, 2010 You can enumerate the forms using _IEFormGetCollection(). You just need to figure out which is the index number for the correct form. There are examples in the help file how to use it. Link to comment Share on other sites More sharing options...
Realm Posted December 10, 2010 Share Posted December 10, 2010 Hello ArturAker, If you can't find your object attached to a form, check to see if the login section is in a frame. I have encountered a couple websites that have created the login section on a seperate page, and frame it to the index or the page in question. If this is the case, all you have to do is navigate to the actual framed document's address, and then you will be able to get the form name and automate it as you need. Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
wakillon Posted December 10, 2010 Share Posted December 10, 2010 If forms have no names, try to identify it by index, action or method and formelements by index, type or id. example#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 ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
cutyourchicken Posted January 5, 2011 Share Posted January 5, 2011 You can enumerate the forms using _IEFormGetCollection(). You just need to figure out which is the index number for the correct form. There are examples in the help file how to use it.great Link to comment Share on other sites More sharing options...
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