Frit Posted March 11, 2006 Share Posted March 11, 2006 First of all, I want to excuse me about the number of topics I've created. I want Autoit to take "numbers from a text" (in this case, from a html document), turn them into variables, play some math on them and fill dialog boxes with the results. It seems to be easy, but the point is: I don't know which numbers there will be (just the words besides them). And I also don't know how to use math on Autoit. All codes will be welcome. Thanks p.s.: Don't you think I'm posting too much? Link to comment Share on other sites More sharing options...
Valuater Posted March 11, 2006 Share Posted March 11, 2006 expandcollapse popup#include <IE.au3> $oIE = _IECreate () _IENavigate ($oIE, "YOUR WEB ADDRESS") $Find = "YOUR WORD BESIDE THE NUMBERS" $After = "THE WORDS AFTER THE NUMBERS" $body = _IEBodyReadHTML ($oIE) $sloc = @TempDir & "\stest.txt" FileDelete($sloc) FileWrite($sloc, $sbody) $sfile = FileOpen($sloc, 0) While 2 $sline = FileReadLine($sfile) If @error Then MsgBox(262208, "Fail", "The string was NOT found ") FileClose($sfile) Exit EndIf If StringInStr($sline, $Find) Then MsgBox(64, "Success", "The string " & $Find & " was found ", 5) $Found = stringbetween($sline, $Find, $after) MsgBox(64, "Found", "The string is" & $Found & " ", 5) EndIf WEnd Func stringbetween($str, $start, $end) $pos = StringInStr($str, $start) If Not @error Then $str = StringTrimLeft($str, $pos + StringLen($start) - 1) $pos = StringInStr($str, $end) If Not @error Then $str = StringTrimRight($str, StringLen($str) - $pos + 1) Return $str EndIf EndIf EndFunc ;==>stringbetween 8) Link to comment Share on other sites More sharing options...
Frit Posted March 11, 2006 Author Share Posted March 11, 2006 Oh Gosh! I'm a little lost there... I'm going to read it all and try to understand how does it works. I don't know all the functions and what do they do. Link to comment Share on other sites More sharing options...
Valuater Posted March 11, 2006 Share Posted March 11, 2006 did it work??? 8) Link to comment Share on other sites More sharing options...
Frit Posted March 11, 2006 Author Share Posted March 11, 2006 "error reading the file IE.au3" :S I haven't read it all, maybe I didn't change some variables, etc.. Link to comment Share on other sites More sharing options...
Valuater Posted March 11, 2006 Share Posted March 11, 2006 you have to get&place the IE.au3 file in the Beta\include folder and make sure you are running the beta version of autoit in SciTE ... press Tools > Run Beta 8) 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