John117 Posted April 20, 2010 Posted April 20, 2010 #include <IE.au3> HotKeySet("{ESC}", "_Exit") HotKeySet('{NumPad1}', '_Run') While 1 Sleep(30) WEnd Func _Run() $URL = "http://peoplestring.com" $ObjIE = ObjCreate("InternetExplorer.Application") ;Wait until Forwarding Website loads With $ObjIE .Visible = True .Navigate($URL) Do Sleep(50) Until .ReadyState = 4 EndWith ;Set Form Objects on Website With $ObjIE.document.forms(0) .user.value = "" .pass.value = "" .submit EndWith EndFunc ;==>_Run Func _Exit() Exit EndFunc ;==>_ExitHey, can't find the form name. Website is in code
PsaltyDS Posted April 20, 2010 Posted April 20, 2010 Use a DOM inspector, like DebugBar, to see if the form is inside frame or within another form. Your .forms(0) returns only the first form from the root of the document. Are you sure it's the first form? 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
Moderators big_daddy Posted April 20, 2010 Moderators Posted April 20, 2010 The form is within an iFrame. #include <IE.au3> $sURL = "http://peoplestring.com/" $sUsername = "username" $sPassword = "password" _IEErrorHandlerRegister() $oIE = _IECreate($sURL, 1) $oFrame = _IEFrameGetCollection($oIE, 0) $oForm = _IEFormGetCollection($oFrame, 0) $oUsername = _IEFormElementGetObjByName($oForm, "user") $oPassword = _IEFormElementGetObjByName($oForm, "pass") _IEFormElementSetValue($oUsername, $sUsername) _IEFormElementSetValue($oPassword, $sPassword) _IEFormSubmit($oForm)
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