mikell Posted March 14, 2010 Share Posted March 14, 2010 Hello Is there a way to silently capture the time displayed on this page : http://www.Heure.com/heure-fr.php?timezone=1&size=36 to use in a gui control or messagebox ? The time doesnt appear in the source of the page, and i cant get WinGetText to work Thanks for any help Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 14, 2010 Share Posted March 14, 2010 Hi, if you find your information in the source code of the site, it is no problem parsing it and getting the desired info. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
mikell Posted March 14, 2010 Author Share Posted March 14, 2010 if you find your information in the source code of the site, it is no problem parsing it and getting the desired info.Xenobiologist, please click on the link I wrote and have a look at the source code : the time is displayed on the page but is NOT written in the source Link to comment Share on other sites More sharing options...
mikell Posted March 14, 2010 Author Share Posted March 14, 2010 This script works : #include <IE.au3> GUICreate("Test", 200, 50, 1, 1) GUISetState(@SW_HIDE) $oIE = _IECreateEmbedded () GUICtrlCreateObj($oIE, 50, 0, 100, 50) _IENavigate ($oIE, "http://free.timeanddate.com/clock/i1z5cxna/n195/th1") While 1 $text = _IEBodyReadText ($oIE) If $text<>"" Then Exitloop Wend MsgBox(0, "", $text) but how can I get a similar result with this site : http://www.Heure.com/heure-fr.php?timezone=1 If it was so easy I shouldnt have bothered Link to comment Share on other sites More sharing options...
BigDod Posted March 14, 2010 Share Posted March 14, 2010 (edited) This works but is messy #include <IE.au3> $oIE =_IECreate ("www.Heure.com/heure-fr.php?timezone=1&size=36", 0) Opt("WinWaitDelay", 1500) WinWaitActive("Heure") $sText = _IEBodyReadText ($oIE) MsgBox(0, "Body Text", $sText) Edit - Slightly better #include <IE.au3> $oIE =_IECreate ("www.Heure.com/heure-fr.php?timezone=1&size=36", 0,0,1) sleep(2000) $sText = _IEBodyReadText ($oIE) MsgBox(0, "Body Text", $sText) Edited March 14, 2010 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
mikell Posted March 14, 2010 Author Share Posted March 14, 2010 Thanks BigDod, it works fine sh*t, when I saw nothing inside the <body> tag in the source, I didnt try !! Thus _IEBodyReadText() can work even when there is apparently nothing in the <body>... Have a nice day Link to comment Share on other sites More sharing options...
Delta Posted March 14, 2010 Share Posted March 14, 2010 Xenobiologist, please click on the link I wrote and have a look at the source code : the time is displayed on the page but is NOT written in the source Actually if you looked at the source code you would have seen that the time is in fact written in the source. http.open('post', 'heures.php?timez=1'); That line right there tells us that the time is being grabbed by "http://www.heure.com/heures.php?timez=1". If you view the source of that page you will see that the time is very plainly displayed. [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
mikell Posted March 15, 2010 Author Share Posted March 15, 2010 OK Delta you're right, I only looked inside the <body> tag and didnt care of this snd.Req() function For the link you gave, the time is plainly displayed in the source so the best way for my script is this : $strURL = "http://www.heure.com/heures.php?timez=1" Local $oTime $oTime = ObjCreate("winhttp.winhttprequest.5.1") $oTime.Open("GET",$strURL) $oTime.Send() If $oTime.Status = 200 Then $text = $oTime.Responsetext $oTime = 0 $time = StringReplace($text, "heure|", "") MsgBox(0, "", $time) but I still dont understand why _IEBodyReadText() works for the other page, I really see nothing written between the <body> and </body> tags when I do "show source" in Firefox 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