anyday Posted March 20, 2006 Share Posted March 20, 2006 Im making a script to naviagte to a website and enter username and password. The problem im having is it will navigate to website but when the IE box pops up asking for username and pass it doesnt do anything. here is my code. #include <ie.au3> $username = "username" $password = "pass" BlockInput (1) $oIE = _IECreate() WinSetState("about:blank - Microsoft Internet Explorer", "", @SW_MAXIMIZE) _IENavigate($oIE, "https://website.com") WinWaitActive ( "Connect to website.com", "&User name" ) ControlSetText ( "Connect to website.com", "&User name", "Edit2", $username ) ControlSetText ( "Connect to website.com", "&User name", "Edit3", $password ) ControlClick ( "Connect to website.com", "&User name", "Button2" ) BlockInput(0) Exit Link to comment Share on other sites More sharing options...
Andrew Sparkes Posted March 20, 2006 Share Posted March 20, 2006 (edited) Instead of trying the Control...() Functions, try _IEForm...() _IEFormGetObjByIndex() Obtain an object variable reference to a form by 0-based index _IEFormGetObjByName() Obtain an object variable reference to a form by name _IEFormElementGetObjByIndex() Obtain a object reference to a form element within a form by 0-based index _IEFormElementGetObjByName() Obtain a object reference to a form element within a form by name _IEFormElementGetValue() Get the value of a specifid form element _IEFormElementSetValue() Set the value of a specified form element _IEFormSubmit() Submit a specified form Those should work for you. IE.au3 is a wonderful file. Sparkes. Edited March 20, 2006 by Andrew Sparkes ---Sparkes. Link to comment Share on other sites More sharing options...
anyday Posted March 20, 2006 Author Share Posted March 20, 2006 thanks for the info, but would _IEForm work if the login and pass is not actually a form on the website but a .htaccess type of pass where it asks before the site even loads? Link to comment Share on other sites More sharing options...
Andrew Sparkes Posted March 20, 2006 Share Posted March 20, 2006 (edited) I am not sure. I have never used it for .htaccess pages... If your code isn't working, double and triple check that you have the right params for the Control...() functions. Perhaps your could try ControlSend() ... That may work... Other than that, I'm afraid I can't help you... It would be a nice feature of the new build of IE.au3 to see it able to fix your problem... Sparkes. EDIT: Typo Edited March 20, 2006 by Andrew Sparkes ---Sparkes. Link to comment Share on other sites More sharing options...
anyday Posted March 20, 2006 Author Share Posted March 20, 2006 just to let everyone who doesnt know already this is what i found out. The _IENavigate function is set to wait till page loads completly before going to next line in script? $f_wait - 1 = wait for page load to complete before returning ; - 0 = return immediately well on the _IENavigate line i just set it this way _IENavigate($oIE, "https://website.com", 0) and after it went to webpage it automatically went to the winwaitactive line which was next in the script. Link to comment Share on other sites More sharing options...
seandisanti Posted March 20, 2006 Share Posted March 20, 2006 just to let everyone who doesnt know already this is what i found out.The _IENavigate function is set to wait till page loads completly before going to next line in script?$f_wait - 1 = wait for page load to complete before returning; - 0 = return immediatelywell on the _IENavigate line i just set it this way_IENavigate($oIE, "https://website.com", 0)and after it went to webpage it automatically went to the winwaitactive line which was next in the script.good idea. thanks for posting the workaround. Link to comment Share on other sites More sharing options...
vaibhavs Posted February 21, 2007 Share Posted February 21, 2007 I am working on the same script as ANYDAY. But I am facing a problem. The website opens and the Username field is getting populated. But the password box is not getting populated. I have copy-pasted the exact code as suggested by ANYDAY and just modified the site parameters. Any suggestions where should I look for problems. No errors in sciTE editor. Pls help. thx vai 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