Sign in to follow this  
Followers 0
myspacee

Fill 'login' & 'password' field

2 posts in this topic

Hello to all,

first post for me here.

I've a question.

read this example :

--------------------------------------------------------------------------------------

; *******************************************************

; Example 3 - Login to Hotmail

; *******************************************************

;

#include <IE.au3>

; Create a browser window and navigate to hotmail

$oIE = _IECreate ("www.hotmail.com")

; get pointers to the login form and username, password and signin fields

$o_form = _IEFormGetObjByName ($oIE, "f1")

$o_login = _IEFormElementGetObjByName ($o_form, "ust")

$o_password = _IEFormElementGetObjByName ($o_form, "passwd")

$o_signin = _IEFormElementGetObjByName ($o_form, "submit")

$username = "mylogin"

$password = "mypassword"

; Set field values and submit the form

_IEFormElementSetValue ($o_login, $username)

_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "submit")

--------------------------------------------------------------------------------------

that fill login & password filed in hotmail page.

I've an internal mail server (Sun Java System Messenger Express) and want to make a script that :

- open my http page

- put login & password

- and press 'login' button

i can't understand what Autoit need to identify fileds in my login page (point to HTML code ?)

(how can i post a file? error message for me :

Upload failed. Please ask the administrator to check the settings and permissions)

Can anyone help me ?

Thank you!

(and sorry for bad english)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I think you may use the method below to fill the fields

$oIE = _IECreate("http://mysite.com/upload.html", 0, 0)

$hwnd = _IEPropertyGet($oIE, "hwnd")

$oForm = _IEFormGetObjByName($oIE, "upload");the form name
$oQuery = _IEFormElementGetObjByName($oForm, "uploaded"); the field name ... you can add more :)



_IEAction($oQuery, "focus")

Sleep(250)

ControlSend($hwnd, "", "Internet Explorer_Server1", "blah blah blah");put here the location of the file you want to upload

ControlSend($hwnd, "", "Internet Explorer_Server1", "{ENTER}");then submit the form by pressing enter

_IEQuit($oIE)
Edited by LIMITER

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