Ram Posted May 13, 2018 Posted May 13, 2018 Hi, I was using the below Gmail script that used to login to my Gmail and password automatically using IE. After the new type of login method in Gmail. I am not able to do it using the below code. Has anyone tried on the auto login script for Gmail for latest Gmail login method? Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail") local $username = _IEGetObjByName ($oIE, "Email") Local $password = _IEGetObjByName ($oIE, "Passwd") Local $Email_button = _IEGetObjByName ($oIE, "Email") Local $Signin_button = _IEGetObjByName ($oIE,"signIn") _IEFormElementSetValue ($username, "mygmailaddress@gmail.com") _IEFormElementSetValue ($password, "mygmailpassword") _IEAction ($Email_button, "click") _IEAction ($Signin_button, "click") if so can someone help me with this? Thanks!
Andreik Posted May 14, 2018 Posted May 14, 2018 This should work fine: #include <IE.au3> $sEmail = 'myemail' $sPassword = 'mypassword' $oIE = _IECreate('https://gmail.com') GMailSubmitFormElement($oIE,'identifier',$sEmail) GMailSubmitFormElement($oIE,'password',$sPassword) Sleep(10000) _IEQuit($oIE) Func GMailSubmitFormElement($oIE,$sElement,$sValue,$iTimeout=10, $iDelay=1) $Timer = TimerInit() Do $oForm = _IEFormGetCollection($oIE,0) $oElement = _IEFormElementGetObjByName($oForm,$sElement) Sleep($iDelay * 1000) Until IsObj($oElement) Or TimerDiff($Timer) >= $iTimeout * 1000 _IEFormElementSetValue($oElement,$sValue) $oViewContainer = _IEGetObjById($oIE,'view_container') $oSpans = _IETagNameGetCollection($oViewContainer,'span') For $oSpan In $oSpans If $oSpan.innerHTML = 'Next' Then _IEAction($oSpan,'click') ExitLoop EndIf Next EndFunc
MJ36 Posted October 16, 2018 Posted October 16, 2018 Unfortunately, the above formula does not work for me ;/
Andreik Posted October 17, 2018 Posted October 17, 2018 Replace If $oSpan.innerHTML = 'Next' Then with If $oSpan.innerHTML = 'Dalej' Then
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