Sign in to follow this  
Followers 0

Website Login Script

4 posts in this topic

Posted

Hello everyone, first let me introduce myself...I am Sean and a NEEEWWWWW AutoIT user. I have a task to complete for work in which we go to a specific website and login, we only have one user id and password, that is why we mainly want it scripted. I have been staring and reading and trying for hours now, and haven't made much progress other than getting the site up. By now you know programming is not my strong suit. I REALLY need you guys help making this work please.

Here is what I have:

$my_url = "https://secure.williams-int.com/customers/login.asp"

ShellExecute ( "C:\Program Files\Internet Explorer\iexplore.exe", $my_url )

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

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

$o_signin = _IEFormElementGetObjByName ($o_form, "Sign In")

$username = "test"

$password = "test"

_IEFormElementSetValue ($o_login, $username)

_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "click")

The "test" was put in intentionally to just test the script I will replace w/ the actual login criteria later. I encourage anyone willing to help to visit the site listed at the top of my script, as I don't think the login/password fields I have are done correctly, however I have tried several variations.

Please help guys....I am visibly frustrated (and my wife agrees)

Share this post


Link to post
Share on other sites



Posted (edited)

#include <IE.au3>

Local $oUser, $oPass, $oSubmit
Local $sUser = "testUsername"
Local $sPass = "testPassword"
Local $url = "https://secure.williams-int.com/customers/login.asp"
Local $oIE = _IECreate($url, 1)

_IELoadWait($oIE)

$oInputs = _IETagNameGetCollection($oIE, "input")
for $oInput in $oInputs
    if $oInput.type = "text" And $oInput.name = "userid" And $oInput.size = "12" Then $oUser = $oInput
    if $oInput.type = "password" And $oInput.name = "password" And $oInput.size = "12" Then $oPass = $oInput
    if $oInput.type = "submit" And $oInput.value = "   SIGN IN   " Then $oSubmit = $oInput
    if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop
Next

$oUser.value = $sUser
$oPass.value = $sPass
_IEAction($oSubmit, "click")

_IELoadWait($oIE)

Edited by ame1011

Share this post


Link to post
Share on other sites

Posted

THANK YOU AME1011!!!!!!!!!!! OH MY GOD, WORKS PERFECT, DEFINITELY A HUGE THANK YOU!!!

Share this post


Link to post
Share on other sites

Posted

Now your wife can have peace again :)

THANK YOU AME1011!!!!!!!!!!! OH MY GOD, WORKS PERFECT, DEFINITELY A HUGE THANK YOU!!!

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

  • Recently Browsing   0 members

    No registered users viewing this page.