shaolin Posted March 28, 2006 Posted March 28, 2006 I want to automate logging into a website. The website changes all the time and the login field moves around the webpage so I can't use the mousemove command and use the same coordinates. Tabbing over to the field also doesn't work because there may be a new picture file near the login field so the number of tab moves I need to make always changes. Any advice on what I should do?
Moderators big_daddy Posted March 28, 2006 Moderators Posted March 28, 2006 (edited) If you could post the source of the webpage between these <form & </form> we should be able to help you out. Edited March 28, 2006 by big_daddy
iverson_est Posted March 28, 2006 Posted March 28, 2006 maybe look here: http://www.autoitscript.com/forum/index.ph...l=hotmail+login
shaolin Posted March 28, 2006 Author Posted March 28, 2006 the URL for the site is:http://www.lexisnexis.com/lawschool/i want to automate logging on for that site.
shaolin Posted March 28, 2006 Author Posted March 28, 2006 iverson, i can do basic scripting through autoit3 but that stuff you linked to is waaay over my head. is there a simple solution to logon to the site that i just posted?
Moderators big_daddy Posted March 28, 2006 Moderators Posted March 28, 2006 (edited) Try this:#include <IE.au3> $oIE = _IECreate() _IENavigate($oIE, "http://www.lexisnexis.com/lawschool/") ; get pointers to the login form and username and password fields $o_form = _IEFormGetObjByName($oIE, "frmLSPLogin") $o_login = _IEFormElementGetObjByName($o_form, "txtLoginID") $o_password = _IEFormElementGetObjByName($o_form, "txtPassword") ; Set field values and submit the form _IEFormElementSetValue($o_login, "test"); Make change here for username _IEFormElementSetValue($o_password, "test"); Make change here for password _IEFormSubmit($o_form)You will need the IE.au3 UDF also. Edited March 28, 2006 by big_daddy
anyday Posted March 28, 2006 Posted March 28, 2006 (edited) you might try this code: #include <ie.au3> $user = "username here" $pass = "Password here" $oIE = _IECreate() WinSetState("about:blank - Microsoft Internet Explorer", "", @SW_MAXIMIZE) _IENavigate($oIE, "http://www.lexisnexis.com/lawschool/") WinWaitActive("LexisNexis for law Schools", "") $o_form = _IEFormGetObjByName($oIE, "frmLSPLogin") $o_login = _IEFormElementGetObjByName($o_form, "txtLoginID") $o_password = _IEFormElementGetObjByName($o_form, "txtPassword") _IEFormElementSetValue($o_login, $user) _IEFormElementSetValue($o_password, $pass) _IEFormSubmit($o_form) im no expert so i dunno i noticed the submit button has a javascript action assigned to it so the _IEFormSubmit() might not work. Edited March 28, 2006 by anyday
Moderators big_daddy Posted March 28, 2006 Moderators Posted March 28, 2006 (edited) WinWaitActive("LexisNexis for law Schools", "")You don't need that part, _IENavigate() does this already. Edited March 28, 2006 by big_daddy
shaolin Posted March 28, 2006 Author Posted March 28, 2006 k to bigdaddy's code i got the error: Line 776 (File "C:\IE.au3"): If IsObj($o_object.elements) Then If IsObj($o_object.e^ERROR Error: Unable to parse line. Ok.
Moderators big_daddy Posted March 28, 2006 Moderators Posted March 28, 2006 k to bigdaddy's code i got the error:Line 776 (File "C:\IE.au3"):If IsObj($o_object.elements) ThenIf IsObj($o_object.e^ERRORError: Unable to parse line.Ok.This is probably due to you not having the beta version.
shaolin Posted March 31, 2006 Author Posted March 31, 2006 i just installed the beta version, yes i have the ie.udf, and man i still got the same error...any ideas?
Moderators big_daddy Posted March 31, 2006 Moderators Posted March 31, 2006 to install the beta is not enough... you must run the script USING the beta. by default script run with release. use "program files" beta shortcut to autoit3.exe beta and choose the script to run. Or install SCITE distrib and use ALT + F5 to run script with beta.Yeah what he said, or what I always do is toggle the beta defs.Program Files-->AutoIT v3-->beta-->Toggle AU3 Beta
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