Sign in to follow this  
Followers 0
Syruz

Reading data from source code?

9 posts in this topic

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)


[center]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.[/center]

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

More reading. Less Typing.

Go over the helpfile. It will not only make you smarter, it will make you look smarter.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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