Spongey Posted March 15, 2007 Posted March 15, 2007 I have a script that opens web addresses listed in a control record. And I need to search each page for a string, and if the string exists, to print that page, then move on to the next ip address in the control record. What function searches the HTML code for a string? That's all I need to know. Many thanks. Spomgey
DaleHohm Posted March 15, 2007 Posted March 15, 2007 _IEBodyReadText (see also _IEReadHTML) will return just the text in a page (using IE) so that you can use String functions to search it. _INetGetSource will return you HTML without using a browser. 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
saldous Posted March 15, 2007 Posted March 15, 2007 (edited) e.g. This script will let you know the current weather in London using HTML source from a web site. #include <INet.au3> #include <array.au3> #include <String.au3> $html = _INetGetSource('http://uk.weather.com/weather/local/UKXX0085') $sStart = "<B>Feels Like<BR>" $sEnd = "°" $Array1 = _StringBetween ($html, $sStart, $sEnd) _ArrayToClip ($Array1) $result = (ClipGet()) MsgBox(0, "London feels like:", $result & " Degrees Centigrade") Edited March 15, 2007 by saldous
Spongey Posted March 22, 2007 Author Posted March 22, 2007 _IEBodyReadText (see also _IEReadHTML) will return just the text in a page (using IE) so that you can use String functions to search it. _INetGetSource will return you HTML without using a browser.DaleThanks! When you say IE, you mean IE.au3? Or, just Internet Explorer?
Spongey Posted March 22, 2007 Author Posted March 22, 2007 e.g. This script will let you know the current weather in London using HTML source from a web site. #include <INet.au3> #include <array.au3> #include <String.au3> $html = _INetGetSource('http://uk.weather.com/weather/local/UKXX0085') $sStart = "<B>Feels Like<BR>" $sEnd = "°" $Array1 = _StringBetween ($html, $sStart, $sEnd) _ArrayToClip ($Array1) $result = (ClipGet()) MsgBox(0, "London feels like:", $result & " Degrees Centigrade")Thanks for the great example! Spongey
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