Sign in to follow this  
Followers 0
Andreik

Click login button

12 posts in this topic

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

Share this post


Link to post
Share on other sites



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 :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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 controlclick

Regards

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0