jimmyjmmy Posted October 25, 2008 Posted October 25, 2008 Hi, Can someone tell me what must I do so that the script below can click yahoo sign-in button. I have the script below but it wont click the sign-in button. $email_address = "abcdef@yahoo.com" $email_password = '12345678 Dim $oIE = _IECreate ("https://login.yahoo.com/config/login_verify2?.src=www&.intl=sg&.done=http://sg.yahoo.com/") WinSetState ( "Sign in to Yahoo! - Windows Internet Explorer", "", @SW_MAXIMIZE ) $yahoo_email_id_form = _IEGetObjByName ($oIE, "username") $yahoo_email_id_value = $email_address _IEFormElementSetValue ($yahoo_email_id_form, $yahoo_email_id_value) $yahoo_email_password_form = _IEGetObjByName ($oIE, "passwd") $yahoo_email_password_value = $email_password _IEFormElementSetValue ($yahoo_email_password_form, $yahoo_email_password_value) $submit = _IEGetObjByName($oIE, "yreglgsb") _IEAction($submit, "click")
dbzfanatic Posted October 25, 2008 Posted October 25, 2008 This is taken from a yahoo mail creator I made a while back. It probably doesn't work anymore but it should get you started. $oIE = _IECreate("mail.yahoo.com",1,1,1,1) $oFilename = @DesktopDir & "\CB Files\accounts.txt" For $i=1 To _FileCountLines($oFilename) $gaiastring = FileReadLine($oFilename,$i) $uName = _IEGetObjById($oIE,"username") $YPass = _IEGetObjById($oIE, "passwd") $Submit = _IEGetObjByName($oIE,".save") $SLI = _IEGetObjById($oIE, "persistent") $userinfo = StringSplit($gaiastring, ":") _IEFormElementSetValue($uName, $userinfo[1]) _IEFormElementSetValue($YPass, $userinfo[2]) _IEFormElementCheckBoxSelect($SLI, ".persistent", ".persistent", 0) $SLI.click $Submit.click _IELoadWait($oIE) Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
Thamiel Posted October 25, 2008 Posted October 25, 2008 (edited) Here an example made from bits of other examples, I have used it myself to make a few Login Proggiesfor different friends and family who at times have trouble remembering their login info.CODE#include <GUIConstantsEx.au3>#include <IE.au3>#include <WindowsConstants.au3>$width = "1024"$height = "768"_IEErrorHandlerRegister() $oIE = _IECreateEmbedded() GUICreate("Automated Yahoo Mail Logon", $width, $height, _ (@DesktopWidth - $width) / 2, (@DesktopHeight - $height) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, $width, $height) GUISetState() _IENavigate($oIE, "https://login.yahoo.com/config/login_verify2?&.src=ym") $o_form = _IEFormGetObjByName($oIE, "login_form") $o_login = _IEFormElementGetObjByName($o_form, "login") $o_password = _IEFormElementGetObjByName($o_form, "passwd") $o_signin = _IEFormElementGetObjByName($o_form, ".save") $username = "UserName" $password = "PassWord" _IEFormElementSetValue($o_login, $username) _IEFormElementSetValue($o_password, $password) _IEAction($o_signin, "click") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelectWEndGUIDelete()ExitBased from this snippet ===> http://quadryders.com/phpcc/snippet.php?sid=92CODE#include <IE.au3> $sUsername = "Your Username"$sPassword = "Your Password" $oIE = _IECreate("http://mail.yahoo.com") ; get pointers to the login form and username and password fields$oform = _IEFormGetObjByName($oIE, "login_form")$ologin = _IEFormElementGetObjByName($oform, "login")$opassword = _IEFormElementGetObjByName($oform, "passwd") ; Set field values and submit the form_IEFormElementSetValue($ologin, $sUsername)_IEFormElementSetValue($opassword, $sPassword)_IEFormSubmit($oform) Edited October 25, 2008 by Thamiel
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