LIMITER Posted January 14, 2008 Share Posted January 14, 2008 Hi all ! I have a script which logins to yahoo mail ... How can i get the "You have 0 unread messages" text ? (that text in bold)I tried with ie_bodyreadtext ... but it returns blankI tried also with ie_bodyreadhtml ... also returns blankand i even used controlgetext ... that also returned blank ...THX !expandcollapse popup#include <GUIConstants.au3> #include <IE.au3> #include <String.au3> #NoTrayIcon #Region ### START Koda GUI section ### Form= $gui = GUICreate("Yahoo! Mail Checker - © 2008 L|M|TER", 270, 90, 193, 125) $id = GUICtrlCreateInput("", 65, 5, 121, 17) $text = GUICtrlCreateLabel("Yahoo! ID :", 5, 5, 58, 17) $text1 = GUICtrlCreateLabel("Password :", 5, 25, 56, 17) $pass = GUICtrlCreateInput("", 65, 25, 121, 17) $beta = GUICtrlCreateRadio("Yahoo! Mail Beta", 5, 50, 103, 17) $classic = GUICtrlCreateRadio("Yahoo! Mail Classic", 110, 50, 113, 17) $result = GUICtrlCreateLabel("Welcome To Yahoo! Mail Checker ! - L|M|TER", 5, 70, 223, 17) $chk = GUICtrlCreateButton("Check !", 190, 5, 75, 35, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $chk Call("check") EndSwitch WEnd Func check() $ie = _IECreate ("http://mail.yahoo.com") $hwnd = _IEPropertyGet($ie, "hwnd") $oForm = _IEFormGetObjByName ($ie, "login_form") $oId = _IEFormElementGetObjByName ($oForm, "login") $oPass = _IEFormElementGetObjByName ($oForm, "passwd") $idt = GUICtrlRead($id) $passt = GUICtrlRead($pass) _IEAction($oId, "focus") Sleep(250) ControlSend($hwnd, "", "Internet Explorer_Server1", $idt) _IEAction($oPass, "focus") Sleep(250) ControlSend($hwnd, "", "Internet Explorer_Server1", $passt) ControlSend($hwnd, "", "Internet Explorer_Server1", "{ENTER}") _IELoadWait($ie) EndFunc Link to comment Share on other sites More sharing options...
Nahuel Posted January 14, 2008 Share Posted January 14, 2008 This works for me: Func check() $ie = _IECreate ("http://mail.yahoo.com") $hwnd = _IEPropertyGet($ie, "hwnd") $oForm = _IEFormGetObjByName ($ie, "login_form") $oId = _IEFormElementGetObjByName ($oForm, "login") $oPass = _IEFormElementGetObjByName ($oForm, "passwd") $idt = GUICtrlRead($id) $passt = GUICtrlRead($pass) _IEAction($oId, "focus") Sleep(250) ControlSend($hwnd, "", "Internet Explorer_Server1", $idt) _IEAction($oPass, "focus") Sleep(250) ControlSend($hwnd, "", "Internet Explorer_Server1", $passt) ControlSend($hwnd, "", "Internet Explorer_Server1", "{ENTER}") _IELoadWait($ie) ;Nahuel's part:== $html=_IEBodyReadHTML($IE) $Test= StringRegExp($html,'(?i)mail16_1.gif(.*?)<b>(.*?)</b>:<br>',1) MsgBox(0,"","You have: " & $Test[1]) ;================= EndFunc Link to comment Share on other sites More sharing options...
LIMITER Posted January 15, 2008 Author Share Posted January 15, 2008 THX !!! Do you know how to get that text from the YAHOO! MAIL BETA webpage ??? Link to comment Share on other sites More sharing options...
Nahuel Posted January 15, 2008 Share Posted January 15, 2008 Well I don't use that one... I don't know how to get it either. Link to comment Share on other sites More sharing options...
LIMITER Posted January 15, 2008 Author Share Posted January 15, 2008 Well I don't use that one... I don't know how to get it either.ok .. thx ! Link to comment Share on other sites More sharing options...
Nahuel Posted January 15, 2008 Share Posted January 15, 2008 ok .. thx !Just look at the source code and use StringRegExp() If you have trouble then post that piece of code (the one that shows in bold the unread messages) and I'll help you. 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