minaset Posted August 2, 2012 Share Posted August 2, 2012 Hi. I have counter in my website. Every time someone visits number will get higher. I would like to get that count to my GUI too. Every time i open my GUI then count should be updated from website, if count number is higher than before HTML code of it in web is : <a class="skill-popup-trigger" href="counter_details.php" rel="counting" id="counting_id">114</a> My guess is that i have to use this line of code: Local $counter = _IEGetObjById($oIE, "counting_id") But how can i make for example msgbox? MsgBox(0, "Hello", $counter) ; This line of code doesn\t work Thanks in advance. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 2, 2012 Moderators Share Posted August 2, 2012 Hi, minaset, can you please include the URL? It is much easier to assist if we can see the page itself. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
minaset Posted August 2, 2012 Author Share Posted August 2, 2012 Well , i actually don't want to write my web address here. I could give bigger html code if it helps. I hope you can still help .. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 2, 2012 Share Posted August 2, 2012 (edited) This might work for you. #include #include Local $Source = _INetGetSource("http://websiteURL") Local $Var = _StringBetween($Source, '[url="counter_details.php"]', '[/url]') MsgBox(0, '', $Var[0])edit: INet.au3 & String.au3 are the included files.. another edit: forget this example, unless you understand the correct usage of the _StringBetween function. It's in the helpfile if you need more info. Edited August 2, 2012 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
minaset Posted August 2, 2012 Author Share Posted August 2, 2012 I cant use this code ? Well i tested it and i got error : Subscript used with non-Array variable. Link to comment Share on other sites More sharing options...
minaset Posted August 3, 2012 Author Share Posted August 3, 2012 Maybe this doesn't work because i have 2 links in my website with counter_details.php ? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 3, 2012 Share Posted August 3, 2012 No, it doesn't work because the editor screwed up the formatting of the example code. I'll PM you a better copy if you want. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
minaset Posted August 5, 2012 Author Share Posted August 5, 2012 It would be great Link to comment Share on other sites More sharing options...
DaleHohm Posted August 6, 2012 Share Posted August 6, 2012 $counter is an object variable - you cannot use it's value directly. Try _IEPropertyGet($counter, "innertext") Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
minaset Posted August 7, 2012 Author Share Posted August 7, 2012 (edited) somdcomputerguy's code worked great. But now i wonder , if it possible if i click a button . Lets say "button" and then then msgbox will appear and tell me the count . with that code before . But i wont close the program and i just close msgbox. And i would like to get another msg if count will be higher than like 500. I would like to use that program as backround program . i click "button" then it shows count . If count will get 500 then appears msgbox which tells that count has reached 500. and the next would be like 1000. and so on. While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button Local $Source = _INetGetSource("http://URL") Local $Var = _StringBetween($Source, '<a class="skill-popup-trigger" href="counter_details.php" rel="counting" id="counting_id">', '</a>') MsgBox(0, '', $Var[0]) ; Waiting till count has reached 500.....[/color][/b] [color=#282828] ; If $Var[0] = 500 then ; MsgBox(0, '',The count has reached $Var[0]) ; count has reached 500 ; ElseIf $Var[0] = 1000 then ; MsgBox(0, '',The count has reached $Var[0]) ; count has reached 1000 ; and so on .. EndSwitch WendIs is possible with that code ? Edited August 7, 2012 by minaset 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