Olsson Posted December 17, 2008 Share Posted December 17, 2008 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">» 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">» 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 More sharing options...
furrycow Posted December 17, 2008 Share Posted December 17, 2008 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">» 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">» 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 More sharing options...
Nahuel Posted December 17, 2008 Share Posted December 17, 2008 I'd use either _StringBetween() or StringRegExp(). I don't think using StringInStr() is the best way. Link to comment Share on other sites More sharing options...
Olsson Posted December 17, 2008 Author Share Posted December 17, 2008 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 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