Jump to content

Recommended Posts

Posted (edited)

Hi !

Im a total newbie in AutoIt Scripts, so i hope that someone can and will help me...

I need help to create a script that can open a certain web page in Internet Explorer and log in with any specific information ....

(Unfortunately, the ability to remember login information on this computer turned off and can not be reactivated because of security on the network.)

On the page there is a form called "Login"

And two fields named UserID and Password + a button labeled "Login"

UserID = Display01

Password = Display01

I need help to write / create a script that can fill the two boxes and then log onto the website ...

I've tried searching on Google etc. but can not find any examples I can get to work ...

Anyone who can / will help me with this ?

Thanks...

Edited by Bonzer
Posted

#include<IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "http://yourURL.com"
$oIE = _IECreate($sUrl, 0, 1, 0, 1)
Sleep(2000)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'login')
$oPassword = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEFormSubmit($oForm)

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted (edited)

#include<IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "http://yourURL.com"
$oIE = _IECreate($sUrl, 0, 1, 0, 1)
Sleep(2000)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'login')
$oPassword = _IEFormElementGetObjByName($oForm, "password")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEFormSubmit($oForm)

Looking very good.... but would you please explain what every single line does.... Edited by Bonzer
Posted

Hi again...

I've tryed the script, and it works... Thanks...

No problem. Glad I could help!

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...