shx Posted July 23, 2012 Share Posted July 23, 2012 I am trying to automate logging in to a website. I am able to have the user id and password entered using an autioit script but can't get the login button clicked. Here is my code. #include <IE.au3> Local $oIE = _IECreate("http://www.helpkidzlearn.com") Local $oForm = _IEFormGetObjByName($oIE, "form1") Local $oUserName = _IEFormElementGetObjByName($oForm, "Login1_UserName") Local $oPassword = _IEFormElementGetObjByName($oForm, "Login1_Password") _IEFormElementSetValue($oUserName, "xxxxxxxxx") _IEFormElementSetValue($oPassword, "yyyyyyyyyy") to click the login button I have tried _IELinkClickByText($oIE, "Login1") _IELinkClickByText($oIE, "Login1_LoginButton") _IELinkClickByText($oIE, "ctl00$Login1$LoginButton") _IEFormImageClick($oIE, "ctl00$Login1$LoginButton", "name") _IELinkClickByIndex($oIE, 19) and can't seem to get it to work. Here is the appropriate code (it think, not really know html) <div class="AspNet-Login" id="Login1"> <fieldset> <label for="Login1_UserName" id="Login1_emailLabel">Username:</label> <input name="ctl00$Login1$UserName" type="text" id="Login1_UserName" /><span id="Login1_EmailValidator" class="valid" style="visibility:hidden;">*</span> <label for="Login1_Password" id="Login1_passwordLabel">Password:</label> <input name="ctl00$Login1$Password" type="password" id="Login1_Password" /><span id="Login1_PasswordValidator" class="valid" style="visibility:hidden;">*</span> <input type="submit" name="ctl00$Login1$LoginButton" value="Login" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$Login1$LoginButton", "", true, "HeaderLogin", "", false, false))" id="Login1_LoginButton" class="register filter" /> <input type="submit" name="ctl00$Login1$RegisterButton" value="Register" id="Login1_RegisterButton" class="login filter" /> </fieldset> <div id="Login1_fail" class="fail"> </div> </div> Any help would be greatly appreciated. Steven Link to comment Share on other sites More sharing options...
JohnOne Posted July 23, 2012 Share Posted July 23, 2012 Any sort of website login discussion id not allowed any more. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
shx Posted July 23, 2012 Author Share Posted July 23, 2012 O.K my apologies. Link to comment Share on other sites More sharing options...
Valik Posted July 23, 2012 Share Posted July 23, 2012 Locked per the rules. Link to comment Share on other sites More sharing options...
Recommended Posts