Sign in to follow this  
Followers 0
Olsson

Extract text from source (IE)

4 posts in this topic

Hey all!

I've been searching around the forums yet I can't find what I'm looking for. I might have overlooked it since I'm not quite sure what I'm looking for.

I'm looking for a way to extract certain text within tags in an HTML document;

CODE

<td><b class="c5 f10" align="right">&raquo; 1</b></td>

<td><b class="c5 f10">Attack</b></td>

<td align="center" class="f10">vid</td>

<td class=\"f10\"><span id=timer1>1:07:50</span> h</td>

</tr></table></div><div id="lrpr">

From that I want to extract;

CODE
<td><b class="c5 f10" align="right">&raquo; 1</b></td>

<td><b class="c5 f10">Attack</b></td>

<td align="center" class="f10">vid</td>

<td class=\"f10\"><span id=timer1>1:07:50</span> h</td>

</tr></table></div><div id="lrpr">

Is there any easy way to do this? If so, how?

Any help will be appriciated!

Olsson

Share this post


Link to post
Share on other sites



Hey all!

I've been searching around the forums yet I can't find what I'm looking for. I might have overlooked it since I'm not quite sure what I'm looking for.

I'm looking for a way to extract certain text within tags in an HTML document;

CODE

<td><b class="c5 f10" align="right">&raquo; 1</b></td>

<td><b class="c5 f10">Attack</b></td>

<td align="center" class="f10">vid</td>

<td class=\"f10\"><span id=timer1>1:07:50</span> h</td>

</tr></table></div><div id="lrpr">

From that I want to extract;

CODE
<td><b class="c5 f10" align="right">&raquo; 1</b></td>

<td><b class="c5 f10">Attack</b></td>

<td align="center" class="f10">vid</td>

<td class=\"f10\"><span id=timer1>1:07:50</span> h</td>

</tr></table></div><div id="lrpr">

Is there any easy way to do this? If so, how?

Any help will be appriciated!

Olsson

If its inside the body tags of the html then you just need to use:

$oHTML=_IEBodyReadHTMLoÝ÷ Ù8^;¬¶ëjëh×6StringInStr ($oHTML, "<b class="c5 f10">") ;This will return the position of where the tag you want for "Attack"

And BINGO is your name-o


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites

I'd use either _StringBetween() or StringRegExp(). I don't think using StringInStr() is the best way.

Share this post


Link to post
Share on other sites

While using StringInStr() I get the following error:

Return $o_object.document.body.innerText

Return $o_object.document^ ERROR

G:\Program\AutoIt3\Include\IE.au3 (2241) : ==> Variable must be of type "Object".:

CODE
$oIE = ObjCreate("Shell.Explorer.2")

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