ironmankho Posted October 12, 2009 Share Posted October 12, 2009 (edited) i am trying to read specific text in web page ... want this txt into variable e.g http://widelec.org/zdjecie,siedziba-blizzarda,3211.htmlmy target text is "Siedziba Blizzard`a" with examine with debugBer V5.3 get this [<H1 class=detail>Siedziba Blizzard`a</H1>]sorry for this type of dumb question ... i am not experent in Auto it ..but your little help will lot for me .basically i am media chance multimedia builder user. Edited October 15, 2009 by ironmankho Link to comment Share on other sites More sharing options...
dantay9 Posted October 12, 2009 Share Posted October 12, 2009 There are several ways to do this, but I always use _InetGetSource(). Once you read the source, parse through the source until you find the right spot. Then you can use _StringBetween() on the source to get the correct text. Post back if you need more explanation. Link to comment Share on other sites More sharing options...
ironmankho Posted October 12, 2009 Author Share Posted October 12, 2009 i need simple method for this ...._InetGetSource() is best ....but is there any alternative method ? i already know that heading of article is always in [<H1 class=detail>Siedziba Blizzard`a</H1>] Link to comment Share on other sites More sharing options...
dantay9 Posted October 12, 2009 Share Posted October 12, 2009 The simplest and most reliable method would be by using the source. I think you could also create an object and read the body text of the web page, but that would be much longer when it isn't needed. Is this what you want? $Source = _INetGetSource("http://widelec.org/zdjecie,siedziba-blizzarda,3211.html") $Between = _StringBetween($Source, '<h1 class="detail">', '</h1>') MsgBox(0, "Result", $Between[0]) Link to comment Share on other sites More sharing options...
DaleHohm Posted October 13, 2009 Share Posted October 13, 2009 (edited) or #include <IE.au3> $oIE = _IECreate("http://widelec.org/zdjecie,siedziba-blizzarda,3211.html") $oH1 = _IETagnameGetCollection($oIE, "h1", 1) ConsoleWrite(_IEPropertyGet($oH1, "innertext") & @CRLF) Dale Edit: changed index from 0 to 1 Edited October 13, 2009 by DaleHohm 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...
ironmankho Posted October 13, 2009 Author Share Posted October 13, 2009 (edited) Thanks for this help dantay9 & DaleHohm .that is why i love auto it ..... now complete code is #include <IE.au3> $oIE = _IECreate("http://widelec.org/zdjecie,siedziba-blizzarda,3211.html") $oH1 = _IETagnameGetCollection($oIE, "h1", 1) $a =_IEPropertyGet($oH1, "innertext") MsgBox(4096, "Test", $a, 10) #include <INet.au3> #Include <string.au3> $Source = _INetGetSource("http://widelec.org/zdjecie,siedziba-blizzarda,3211.html") $Between = _StringBetween($Source, '<h1 class="detail">', '</h1>') MsgBox(0, "Result", $Between[0]) Edited October 13, 2009 by ironmankho 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