Jump to content

Facebook _IE Login


Recommended Posts

Hello!

I can't understand what I do wrong. I get this error when the script should post the email and password:

--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType

My code for this is:

Case $loginButton
            $varInputuser = GUICtrlRead($inputUsername)
            $varInputpass = GUICtrlRead($inputPassword)
            _IEErrorHandlerRegister()
            _IELoadWaitTimeout($Timeout)
            $oIE = _IECreate("http://www.facebook.com/login.php")
            $oForm = _IEFormGetObjByName($oIE, "loginform")
            $oQuery = _IEFormElementGetObjByName($oForm, "email")
            $o_Query = _IEFormElementGetObjByName($oForm, "pass")
            $oSubmit = _IEFormElementGetObjByName($oForm, "u934367_1")
            _IEFormElementSetValue($oQuery, $varInputuser)
            _IEFormElementSetValue($o_Query, $varInputpass)
            _IEAction($oSubmit, "click")
            _IELoadWait($oIE, $Timeout, $Timeout)

Sorry my bad! Wrong Values. I post the right ones if someone needs it:

Case $loginButton
            $varInputuser = GUICtrlRead($inputUsername)
            $varInputpass = GUICtrlRead($inputPassword)
            _IEErrorHandlerRegister()
            _IELoadWaitTimeout($Timeout)
            $oIE = _IECreate("http://www.facebook.com/login.php")
            $oForm = _IEFormGetObjByName($oIE, "login_form")
            $oQuery = _IEFormElementGetObjByName($oForm, "email")
            $o_Query = _IEFormElementGetObjByName($oForm, "pass")
            $oSubmit = _IEFormElementGetObjByName($oForm, "login")
            _IEFormElementSetValue($oQuery, $varInputuser)
            _IEFormElementSetValue($o_Query, $varInputpass)
            _IEAction($oSubmit, "click")
            _IELoadWait($oIE, $Timeout, $Timeout)

$timeout = 5000
Edited by TheScriptkiddie
Link to comment
Share on other sites

I'm pretty new to Autoit but I was wanting to do something similar and I found this URL that might help:

And I adapted some of what I found there in to your code and tried it out (with my own login info, of course) and this works. I think this will get you a little further.

_IEErrorHandlerRegister()

_IELoadWaitTimeout($timeout)

$oIE = _IECreate("http://www.facebook.com/login.php")

;;;; The next two lines are pretty much all I added;;;;

$oHWND = _IEPropertyGet($oIE, "hwnd")

WinSetState($oHWND, "", @SW_MAXIMIZE)

$oForm = _IEFormGetObjByName($oIE, "login_form")

$oQuery = _IEFormElementGetObjByName($oForm, "email")

$o_Query = _IEFormElementGetObjByName($oForm, "pass")

$oSubmit = _IEFormElementGetObjByName($oForm, "login")

_IEFormElementSetValue($oQuery, $varInputuser)

_IEFormElementSetValue($o_Query, $varInputpass)

_IEAction($oSubmit, "click")

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...