Sign in to follow this  
Followers 0

Automatically log into

1 post in this topic

#1 ·  Posted (edited)


I am trying to log into using AutoIt.
There are several examples, but none of them work with the current webpage.

This is my code (because the username and password are not valid ;-) , I comment the "button click" out.):

#include <IE.au3>

Local $oIE = _IECreate("")
_IELoadWait ($oIE)
_IELinkClickByText($oIE, "Sign in")

$o_form = _IEFormGetObjByName ($oIE, "f1")
$o_login = _IEFormElementGetObjByName ($o_form, "loginfmt")
$o_password = _IEFormElementGetObjByName ($o_form, "passwd")
$o_signin = _IEFormElementGetObjByName ($o_form, "idSIButton9")

$username = ""
$password = "testpassword"

_IEAction ($o_login, "focus")
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)

;_IEAction ($o_signin, "click")

When I run the code I get the following:


The value being set is garbeled with "PlaceholderText".
Because of this, the username and password are invalid.

Here screenhot of the placeholders text:


When you start typing in one of the fields, the placeholder text is automatically deleted.
When you set a value it stays.

I found a workaround, to set focus on the element and send the username as an keyboard input to the field,
but I would like a clean solution based on variables.

So, does anyone now how to do this?





Edited by Jemboy
typing error

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

  • Similar Content

    • Blank517
      SQLite login
      By Blank517
      Hi, I would like to make a login script with SQLite. The database looks like this:
      _SQLite_Exec(-1, "CREATE TABLE Users (id INT(8) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(255) NOT NULL, permission INT(8) NOT NULL, PRIMARY KEY (id)); CREATE UNIQUE INDEX 'user_name_unique' ON 'Users' ('username' );") _SQLite_Exec(-1, "INSERT INTO Users(id, username, password, permission) VALUES ('0', 'default', 'password', '0');")
      theoretically I should make a query in this way, right?
      _SQLite_Query (-1, "SELECT id FROM Users WHERE username = '" & $ Recv [1] & "' AND password = '" & $ Recv [2] & "';", $ hQuery)
      but then I do not know how to know if you have found the 'id'
    • shikherg
      Multiple login using details in excel file
      By shikherg
      i have a list of usernames and passwords in an excel file (row 1 : username1, password1, row 2 : username2, password2 ... likewise) the work (login, do some work, log out, login with second user, do same work, log out.. likewise) is same for each user. how do i create a script with that?
    • clariceo0
      Free library for resetting windows password?
      By clariceo0
      Recently, I am interested to build a windows app to reset Windows login password as a side off project. I am still a newbie in programming so i am not able to build the app from scratch. Is there any open source  project i could learn from on this?
    • zxtnt09
      Error - My Script
      By zxtnt09
      Hi guys,
      i was use that, to know "Username" is create or not,etc.
      but i have problem
      #include <IE.au3> #include <INet.au3> #include <String.au3> signIn() Func signIn () Global $oIE = _IECreate ("") Local $username = _IEGetObjByName ($oIE,"username") Local $password = _IEGetObjByName ($oIE,"passwd") Local $btn = _IEGetObjByName ($oIE,"signin") _IEFormElementSetValue ($username,"AsdfavsdASWddsaA") _IEFormElementSetValue ($password,"123456") _IEAction ($btn,"click") $url = "" $first = '<html>' $end = '</html>' $read = _StringBetween(_INetGetSource($url), $first, $end) If $read[0] == "This ID is not yet taken." Then MsgBox (16,"","This ID is not create yet!") Else MsgBox (16,"","This ID was created!") EndIf EndFunc Please help i'll be die with errors 
    • akira2891
      Facebook login / chat
      By akira2891
      Hi, im trying to make a small facebook messenger, but normally that i have problem since im here
      How to get all friend and chat with them ? over TCP or UDP ?
      And now window is not hidden but in future will be and process too.
      Im not so good in explaining things but here is code
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIListBox.au3> #include <IE.au3> Global $window = _IECreate('', 0, 0, 1), $Form1, $login, $email, $password, $stayLogged Local $oWbn = _IEGetObjById($window, "pagelet_welcome_box") If IsObj($oWbn) = 0 Then ;~ MsgBox(0, '', 'not logged') $Form1 = GUICreate("Facebook messenger", 359, 210, 338, 218) GUICtrlCreateGroup("", 10, 8, 337, 137) GUICtrlSetFont(-1, 10, 800, 0, "Calibri") GUICtrlCreateLabel("Email :", 64, 36, 40, 19) $email = GUICtrlCreateInput("", 107, 32, 217, 23) GUICtrlCreateLabel("Password :", 41, 73, 63, 19) $password = GUICtrlCreateInput("", 107, 70, 217, 23, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) $stayLogged = GUICtrlCreateCheckbox("Stay logged", 107, 104, 97, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $login = GUICtrlCreateButton("Login", 10, 156, 337, 41) GUICtrlSetFont(-1, 12, 800, 0, "Calibri") GUISetState(@SW_SHOW) Else GUIDelete($Form1) ; if already logged in show other form ;~ MsgBox(0, '', 'logged in') $Form2 = GUICreate("Facebook Chat", 448, 466, 299, 146) $friendlist = GUICtrlCreateList("", 16, 16, 417, 266) $chatwindow = GUICtrlCreateList("", 16, 296, 417, 97) $text = GUICtrlCreateInput("", 16, 392, 417, 21) $sendBtn = GUICtrlCreateButton("Send", 360, 424, 75, 25) $logout = GUICtrlCreateButton("Logout", 16, 424, 75, 25) GUISetState(@SW_SHOW) EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $login _checkLogin() Case $sendBtn _sendMsg() EndSwitch WEnd ; check login Func _checkLogin() If IsObj($oWbn) = 0 Then ; if not logged in ; check if empty fields If GUICtrlRead($email) == '' Or GUICtrlRead($password) == '' Then MsgBox(64, 'Info', 'Please enter email and password') Else #cs - opens hidden internet explorer window - opens facebook page - get ID's form, email, password, remember me, and submit button - set values from GUI - submit form #ce $formID = _IEGetObjById($window, 'login_form') $emailID = _IEGetObjById($window, 'email') $passID = _IEGetObjById($window, 'pass') $rememberID = _IEGetObjById($window, 'persist_box') $loginBtnID = _IEGetObjById($window, 'u_0_v') _IEFormElementSetValue($emailID, GUICtrlRead($email)) ; set email _IEFormElementSetValue($passID, GuictrlRead($password)) ; set password ; check for stay logged checkbox If GUICtrlRead($stayLogged) = $GUI_CHECKED Then _IEFormElementCheckBoxSelect($formID, 'persistent', '', 1, 'byIndex') Sleep(1000) EndIf _IEFormSubmit($formID) ; submit form EndIf ;=> login form EndIf ;=> if not logged in EndFunc ;=> check login ; send message Func _sendMsg() GUICtrlSetData($chatwindow, GUICtrlRead($text)) EndFunc