SammyNew Posted May 28, 2014 Share Posted May 28, 2014 (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 May 28, 2014 by SammyNew Link to comment Share on other sites More sharing options...
jguinch Posted May 28, 2014 Share Posted May 28, 2014 Isn't it illegal to have multiple Facebook accounts for the same person? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
SammyNew Posted May 28, 2014 Author Share Posted May 28, 2014 These are not only my accounts, also from other familymembers Link to comment Share on other sites More sharing options...
SammyNew Posted May 28, 2014 Author Share Posted May 28, 2014 (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 May 28, 2014 by SammyNew Link to comment Share on other sites More sharing options...
Danp2 Posted May 28, 2014 Share Posted May 28, 2014 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") Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
SammyNew Posted May 28, 2014 Author Share Posted May 28, 2014 (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 May 28, 2014 by SammyNew Link to comment Share on other sites More sharing options...
Danp2 Posted May 28, 2014 Share Posted May 28, 2014 I ran it both ways (with / without valid ID) without issue, but I'm living dangerously with XP / IE8. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
SammyNew Posted May 28, 2014 Author Share Posted May 28, 2014 (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 Is there somebody with windows 7 who can comfirm that it works/doesn't work? edit: almost forgot to thank you Danp2 , forgive me. Edited May 28, 2014 by SammyNew Link to comment Share on other sites More sharing options...
AutID Posted May 28, 2014 Share Posted May 28, 2014 Win 7 ultimate. The code on post 1 works. https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
SammyNew Posted May 29, 2014 Author Share Posted May 29, 2014 very strange, thanks for the support but I don't need it any longer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now