Sign in to follow this  
Followers 0
SammyNew

Sign out of facebook

10 posts in this topic

#1 ·  Posted (edited)

Hello everybody,

First of all I'm new here so I don't know if this is the right place to post this.

I want to write an autoIt application that fires up 3 browser windows with each browser window logged on to a different facebook account. I don't know if this possible because of the cookies and session information stored in the browser.

I already found this on the forum:

'?do=embed' frameborder='0' data-embedContent>>

This works like a charm (I had to remove the _IEErrorHandlerRegister(), that's all ;) ), but that's only for one account. Does anyone know how to do it for multiple accounts?

 

Well I'm going to login the accounts after eachother, so no more simultaneously logging in of accounts.

Yo achieve this I need to be able to sign out of facebook.

$oIE = _IECreate("http://www.facebook.com/login.php")
;I log in and stuff
Sleep(5000)
$obj = _IEGetObjById( $oIE, "logout_form" )
Sleep(5000)
_IEFormSubmit($obj)

Sadly this doesn't work. I get the error 

--> IE.au3 T3.0-1 Warning from function _IEGetObjById, $_IEStatus_NoMatch (logout_form)
--> IE.au3 T3.0-1 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType
 
In javascript I have no problem achieving this, it just works when I run:
document.getElementById("logout_form").submit()

Does anyone know how to logout of facebook using autoit?

 

Edited by SammyNew

Share this post


Link to post
Share on other sites



These are not only my accounts, also from other familymembers

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Can somebody tell me why this function doesn't work:

Func FBLogin()



               $timeout = 5000
              _IELoadWaitTimeout($timeout)
                $oIE = _IECreate("http://www.facebook.com/login.php")
                $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, "usernameForFacebook")
            _IEFormElementSetValue($o_Query, "facebookPassword")
            _IEAction($oSubmit, "click")
            Sleep(3000)
            _IENavigate($oIE, "www.google.com")



EndFunc ;FBLgin()

I always get the --> IE.au3 T3.0-1 Error from function _IENavigate, $_IEStatus_COMError (-2147352567) error when I try to navigate to google... I think it's because of the url changed after you log in to facebook... It might be a bug. Can somebody comfirm that?

Edited by SammyNew

Share this post


Link to post
Share on other sites

The code runs for me without error. However, you may be running into an issue where the IE object gets destroyed due to switching from a secure to a non-secure website. Does it work if you change the last line to:

_IENavigate($oIE, "https://www.google.com")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Changed it like this:

Func FBLogin()



               $timeout = 5000
              _IELoadWaitTimeout($timeout)
                $oIE = _IECreate("https://www.facebook.com/login.php")
                $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, "usernameForFacebook")
            _IEFormElementSetValue($o_Query, "facebookPassword")
            _IEAction($oSubmit, "click")
            Sleep(10000)
            _IENavigate($oIE, "https://www.google.com")



EndFunc

Still getting that  --> IE.au3 T3.0-1 Error from function _IENavigate, $_IEStatus_COMError (-2147352567) error :(

using IE 11.0.9600.17107 windows 7 (64 bit)

 

edit: did you run the script exact the same way with the fake username/password that results in an invalid login on facebook?

Edited by SammyNew

Share this post


Link to post
Share on other sites

I ran it both ways (with / without valid ID) without issue, but I'm living dangerously with XP / IE8. :geek:

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

hmmmm made an executable out of it and ran it on windwows 8. Gave me an error at line <Isert gigantic number> very strange...very disappointing  :ermm:

Is there somebody with windows 7 who can comfirm that it works/doesn't work?

edit: almost forgot to thank you Danp2 :D, forgive me.

Edited by SammyNew

Share this post


Link to post
Share on other sites

very strange, thanks for the support but I don't need it any longer.

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