Jump to content
Sign in to follow this  
ironmankho

[solved]simple and dumb question of _IE .UDF

Recommended Posts

ironmankho

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

Share this post


Link to post
Share on other sites
dantay9

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.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
ironmankho

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

Share this post


Link to post
Share on other sites
dantay9

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

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
DaleHohm

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

Share this post


Link to post
Share on other sites
ironmankho

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

Share this post


Link to post
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
Sign in to follow this  

×