Jump to content
Sign in to follow this  
James

IE.au3

Recommended Posts

James

Can you help me with this please? I'm trying to make my AutoIT login box, do it automatically without the mouse movements, but for some reason my script won't work.

;; AutoIT login V2
;; Thanks to everyone for mocking me,
;; I decided to show you I can make it AUTO(IT)

#include <IE.au3>
; Create a browser window and navigate to AutoIT Forums

$url = "www.autoitscript.com/forum/index.php"
$username = "xxxx"
$password = "xxxx"

$oIE = _IECreate ($url, 1)
$title = "AutoIT Forums"
WinSetState($title, "", @SW_MAXIMIZE)
$o_form = _IEFormGetObjByName ($oIE, "login_form")
$o_login = _IEFormElementGetObjByName ($o_form, "UserName")
$o_password = _IEFormElementGetObjByName ($o_form, "PassWord")

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
_IEFormSubmit ($o_form, 0)
_IELoadWait ($oIE)

Share this post


Link to post
Share on other sites
mikehunt114

What is your console output?


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites
someone

Your problem is the form for the username/password doesn't have a name associated with it so you have to use IEFormGetCollection instead...

;; AutoIT login V2
;; Thanks to everyone for mocking me,
;; I decided to show you I can make it AUTO(IT)

#include <IE.au3>
; Create a browser window and navigate to AutoIT Forums
$url = "www.autoitscript.com/forum/index.php"
$username = "xxxx"
$password = "xxxx"

;$oIE = _IECreate ($url, 1)
$oIE = _IECreate ($url)
$title = "AutoIT Forums"
WinSetState($title, "", @SW_MAXIMIZE)
$o_form = _IEFormGetCollection ($oIE, 0)
;$o_form = _IEFormGetObjByName ($oIE, "login_form")
$o_login = _IEFormElementGetObjByName ($o_form, "UserName")
$o_password = _IEFormElementGetObjByName ($o_form, "PassWord")

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
_IEFormSubmit ($o_form, 0)
;_IELoadWait ($oIE)

Also I wasn't sure why you had the last _IELoadWait command, but the script works fine without it. Are you trying to reuse an exsisting IE window or create a new one? I didn't have any luck with the _IECreate ($url,1) but I have had a lot of luck using _IEAttach... I would recommend trying that.

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites
AzKay

Works fine for me.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.