Jump to content

Extract text from source (IE)


Olsson
 Share

Recommended Posts

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

Link to comment
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
Link to comment
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")
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...