Ahmed97 Posted June 13, 2014 Posted June 13, 2014 (edited) hello, what's wrong with this script? It's for loging in facebook, it writes in user&pw then submit and get the bodytxt to know if "signup" still there or no & to know if the login was successfully or not. It always says login successfully when it's failed !! Is there anyway to do it? or to check login succeed? #include <ie.au3> #include <file.au3> $ie = _IECreate("www.facebook.com/login") _IELoadWait($ie) $ieform = _IEFormGetCollection($ie, 0) $ieUser = _IEFormElementGetObjByName($ieform, 'email') $iePass = _IEFormElementGetObjByName($ieform, 'pass') _IEFormElementSetValue($ieUser, "test@hotmail.com") _IEFormElementSetValue($iePass, "password") $iesubmit = _IEGetObjByName($ie, "login") _IEAction($iesubmit, "click") _IELoadWait($ie) $txtBody = _IEBodyReadText($ie) $string = StringInStr($txtBody, "signup") If $string = 0 Then MsgBox(0, "", "Login successfully.") ElseIf $string > 0 Then MsgBox(0, "", "Login failed, try again") $z = _IEAction($ie, "back") ; here the error comes and it don't back If $z = 1 Then MsgBox(0, "", "BACKed") ;; this never get called, whether logged in or not ! EndIf another problem that the "_IEAction($ie, "back") and _IEActionNavigate() doesn't work with me and gets me this error "IE.au3 T3.0-1 Error from function _IEAction(back), $_IESTATUS_COMError (-2147352567)" Edited June 14, 2014 by Ahmed97
Danp2 Posted June 14, 2014 Posted June 14, 2014 The word "login" doesn't occur in the web page's text, which would explain why the code is working as you describe. Try changing _IEBodyReadText to _IEBodyReadHTML. Latest Webdriver UDF Release Webdriver Wiki FAQs
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