Andreik Posted December 27, 2008 Share Posted December 27, 2008 I create a script to put the email and the password on this site http://123kids.ro/index.php but I don't know how to click on login button.How can I do that? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Rydextillxixdiex Posted December 27, 2008 Share Posted December 27, 2008 The easiest way, if only being used on your one computer/monitor is to use a simple mouse move & click which you can customize based on the where the coordinates lay on your monitor. MouseClick("Left", x, y, 1, 0) obviously replace the x/y with the coordinates that the button are on your monitor. If this isn't what you wanted or want it to work on many computers then this may at least be a temporary fix. ...will never learn all there is to know about autoit, no worries...i came to the forums :) Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 Look at IE UDF Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Andreik Posted December 27, 2008 Author Share Posted December 27, 2008 Look at IE UDF I tried with this code, work fine to put the email and the password but not to login: #include <IE.au3> $email = "my_email" $password = "my_password" $oIE = _IECreate("http://123kids.ro/index.php") _IELoadWait($oIE) $oEmail = _IEGetObjByName($oIE,"email") _IEFormElementSetValue($oEmail,$email) $oPassword = _IEGetObjByName($oIE,"password") _IEFormElementSetValue($oPassword,$password) $oForm = _IEFormGetObjByName($oIE,"lg") _IEFormSubmit($oForm) This is a part of page source: <form name="lg" method="POST"> <div class="login"><font class="text">email:</font> <input type="text" name="email" class="texta" style="color: #CC0000"></input></div> <div class="login"><font class="text">parola:</font> <input type="password" name="password" class="texta"></input></div><br /> <div style="width: 32px; height: 10px; float: left; font-size: 1px;"></div> <div style="float: left; margin-top: 7px;"><a href="send-pass.php" class="orange"><b>ai uitat parola?</b></a></div> <div style="float: left; padding-left: 30px; margin-top: 5px;"><input type="button" class="but" onmouseout="this.className='but'" onmouseover="this.className='but_hover'" onclick="Login()" ></div><br clear="all" /><br /> </form> Probably somewhere the code is wrong. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 Try this #include <IE.au3> $email = "my_email" $password = "my_password" $oIE = _IECreate("http://123kids.ro/index.php") ;_IELoadWait($oIE) $oForm = _IEFormGetObjByName($oIE,"lg") $oEmail = _IEFormElementGetObjByName ($oForm,"email") _IEFormElementSetValue($oEmail,$email) $oPassword = _IEFormElementGetObjByName($oForm,"password") _IEFormElementSetValue($oPassword,$password) _IEFormSubmit($oForm) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Andreik Posted December 27, 2008 Author Share Posted December 27, 2008 (edited) Try this #include <IE.au3> $email = "my_email" $password = "my_password" $oIE = _IECreate("http://123kids.ro/index.php") ;_IELoadWait($oIE) $oForm = _IEFormGetObjByName($oIE,"lg") $oEmail = _IEFormElementGetObjByName ($oForm,"email") _IEFormElementSetValue($oEmail,$email) $oPassword = _IEFormElementGetObjByName($oForm,"password") _IEFormElementSetValue($oPassword,$password) _IEFormSubmit($oForm)Does not work. _IEFormSubmit Remarks For many HTML forms it is not sufficient to use _IEFormSubmit() because there is often custom Javascript tied to an onclick event for its Submit button. Is there any other way to identify the login button and click on it? I tried to use _IETagNameGetCollection but without success. Edited December 27, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 Does not work. Is there any other way to identify the login button and click on it?I tried to use _IETagNameGetCollection but without success. I saw some replies from Dale on the forum with workarounds for that situation.But I don't remember details. Try to search posts by Dale... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Kyme Posted December 27, 2008 Share Posted December 27, 2008 Does not work. Is there any other way to identify the login button and click on it?I tried to use _IETagNameGetCollection but without success.try to use _IElinkclickbytext ...if don't work...the last solution what i see it's controlclickRegards Link to comment Share on other sites More sharing options...
Andreik Posted December 27, 2008 Author Share Posted December 27, 2008 @Kyme Does not work with _IELinkClickByText. @Zedna Thanks. I read a few replies in several topics of Dale. Lastly I did that: _IEAction($oPassword,"focus") Send("{TAB}{TAB}{ENTER}") Ugly but work. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 search for onclick from Dale:http://www.autoitscript.com/forum/index.ph...st&p=509212 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted December 27, 2008 Share Posted December 27, 2008 $osv = _IEGetObjById($oIE, "save_button") $osv.fireEvent("onclick")http://www.autoitscript.com/forum/index.ph...st&p=507214 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Andreik Posted December 27, 2008 Author Share Posted December 27, 2008 (edited) $osv = _IEGetObjById($oIE, "save_button") $osv.fireEvent("onclick") http://www.autoitscript.com/forum/index.ph...st&p=507214Thank you Zedna. Edited December 27, 2008 by Andreik When the words fail... music speaks. 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