Jump to content

Website Login


Recommended Posts

Here's a simple GUI to login into a website (in this case craigslist).

I want to recreate this using Firefox instead of IE.

Can someone help?

Thanks,

Ed

#include <IE.au3>
#include <GUIConstants.au3>
#include <File.au3>

GUICreate ("Acess Website GUI",600,300)
GUISetBkColor (0x99FFCC)
GUISetState(@SW_SHOW)

GUICtrlCreateLabel("Click a button to begin...", 30, 10, 200)
GUICtrlSetFont (-1,12, 800, 2, "Arial") 

Opt("GUICoordMode",1)
$button1 = GUICtrlCreateButton ("Craigslist",  40, 60, 100)
$close = GUICtrlCreateButton ("Close",  260, 260, 80)

While 1
  $msg = GUIGetMsg()
  Select
    Case $msg = $button1
         $account="email@email.com"
         $pw="password"
      Account($account,$pw)
     Case $msg = $close
        $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
  EndSelect
WEnd 
Exit

;FUNCTIONS
Func Account($account,$pw)

$oIE = _IECreate()
_IENavigate($oIE, "https://accounts.craigslist.org/")

$o_form = _IEFormGetObjByName($oIE, "login")
$o_login = _IEFormElementGetObjByName($o_form, "inputEmailHandle")
$o_password = _IEFormElementGetObjByName($o_form, "inputPassword")

_IEFormElementSetValue($o_login,$account)
_IEFormElementSetValue($o_password, $pw)
Sleep(500)
_IEFormSubmit($o_form)
EndFunc
Link to comment
Share on other sites

Thanks for sharing your working code...

Ooops!

Simple thanks to FF.au3 and FF_AutoLogin.au3

Here's the code:

Enjoy!

#include <FF.au3>
#include <FF_AutoLogin.au3>

$account = "YourName@YourEmail.com"
$pw = "YourPassword"

_FFStart("https://accounts.craigslist.org/") 

;_FFConnect ()
_FF_AutoLogin($account,$pw)
Link to comment
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
 Share

  • Recently Browsing   0 members

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