Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Website Login Script


  • Please log in to reply
3 replies to this topic

#1 Sean78

Sean78

    Seeker

  • Active Members
  • 12 posts

Posted 28 October 2009 - 12:46 AM

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)







#2 ame1011

ame1011

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 250 posts

Posted 28 October 2009 - 05:01 AM

AutoIt         
#include <IE.au3> Local $oUser, $oPass, $oSubmit Local $sUser = "testUsername" Local $sPass = "testPassword" Local $url = "<a href='https://secure.williams-int.com/customers/login.asp' class='bbc_url' title='External link' rel='nofollow external'>https://secure.williams-int.com/customers/login.asp"</a> 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, 28 October 2009 - 05:30 AM.

I always thought dogs laid eggs, and I learned something today.

#3 Sean78

Sean78

    Seeker

  • Active Members
  • 12 posts

Posted 28 October 2009 - 12:12 PM

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

#4 gte

gte

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 287 posts

Posted 28 October 2009 - 12:35 PM

Now your wife can have peace again :)


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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users