Jump to content
Sign in to follow this  
BALA

Searching for a certain string in the HTML

Recommended Posts

BALA

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
nobbe

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
BALA

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
SmOke_N

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
nobbe

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.