Jump to content

[solved]simple and dumb question of _IE .UDF


Recommended Posts

i am trying to read specific text in web page ... want this txt into variable

e.g

http://widelec.org/zdjecie,siedziba-blizzarda,3211.html

my target text is "Siedziba Blizzard`a" with examine with debugBer V5.3 get this [<H1 class=detail>Siedziba Blizzard`a</H1>]

Posted Image

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 by ironmankho
Link to comment
Share on other sites

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

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

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 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

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 by ironmankho
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...