Jump to content
Sign in to follow this  
Syruz

Reading data from source code?

Recommended Posts

Is there a way to search if the source code of a web page contains a word from a list/array of keywords? (using IE.au3). So it has to search if the source contains any word from a list of many keywords.

Share this post


Link to post
Share on other sites

Is there a way to search if the source code of a web page contains a word from a list/array of keywords? (using IE.au3). So it has to search if the source contains any word from a list of many keywords.

Well... StringRegExp+(_IEBodyReadHTML or _IEBodyReadText)

Or StringReplace + @extended + (_IEBodyReadHTML or _IEBodyReadText)

Or StringInStr + (_IEBodyReadHTML or _IEBodyReadText)

Or StringRegExpReplace + (_IEBodyReadHTML or _IEBodyReadText)


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

So theoretically this should work?

$o_body = _IEBodyReadHTML($o_IE)

for %i = 0 to 30

If stringinstr($o_body, keyword(i))

;perform action

EndIf

Next

Share this post


Link to post
Share on other sites

So theoretically this should work?

$o_body = _IEBodyReadHTML($o_IE)

for %i = 0 to 30

If stringinstr($o_body, keyword(i))

;perform action

EndIf

Next

Yes.. theoretically... as I have no way to test what you are doing.... but that looks like how I would approach it.

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

Ok, and sorry, just just beginning with AutoIt today. Is there a way to load a text file(containing keywords) into a list/array?

Edited by Syruz

Share this post


Link to post
Share on other sites

Ok, and sorry, just just beginning with AutoIt today. Is there a way to load a text file(containing keywords) into a list/array?

You'll have to be a lot more elaborate than that.

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

Like, lets say I have a .txt file which contains a list of keywords that I want to check if they are in the source, is there a way to fill an array by loading that text file. As in my earlier post im checking if in the body text there are any keywords from an array of keywords If stringinstr($o_body, keyword(i)).

Edited by Syruz

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  

×
×
  • Create New...