Sign in to follow this  
Followers 0
BALA

Searching for a certain string in the HTML

7 posts in this topic

#1 ·  Posted (edited)

I'm trying to search for specific strings inside an HTML source I got using _IEDocReadHTML. I wandering how I could do this, perhaps with one of the String functions or such.

EDIT: Corrected a typo: "string" should have been "strings"

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites



yup stringInStr() should do it

Share this post


Link to post
Share on other sites

hi

in case you need only the text (not the full HTML code)

$sText = _IEBodyReadText($oIE)

or the full html code

$sText = _IEBodyReadHTML($oIE)

now the $sText can the used as any other string variable..

If StringInStr($sText, "login.gif") > 0 Then

nobbe

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for the respond, but StringInStr isn't exactly what I'm looking for. I need a command that will search for 2 strings ("string1" and "string2"), then copy anything in between those two strings. I'm pretty sure there's a function that does that, I just can't remember what it's called.

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

2 strings ("string1" and "string2"), then copy anything in between those two strings. I'm pretty sure there's a function that does that, I just can't remember what it's called.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

StringRegExp ?

Share this post


Link to post
Share on other sites

hi

$sText = _IEBodyReadHTML($oIE)

$return = _StringBetween($sText, 'karte.php\?d=', 'onmouseout', -1, 1)

that was easy...

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