Sign in to follow this  
Followers 0
AcidCorps

Read Page and Copy whats next to it

5 posts in this topic

I'm trying to get it so that I can read a webpage and copy text that next to the text I search for

so if the pages says

This is an example page

it could find "This is" and then copy "example page" to a variable

Share this post


Link to post
Share on other sites



I'm trying to get it so that I can read a webpage and copy text that next to the text I search for

so if the pages says

This is an example page

it could find "This is" and then copy "example page" to a variable

Are you using the IE.au3 UDF? Have you opened IE and navigated to the page? Have you read the HTML to a string variable? How far along are you?

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

sorry I don't have the code on this computer that I'm posting from or I would post what I have so far

I have it so that it has read the page and put it in a string variable

Share this post


Link to post
Share on other sites

sorry I don't have the code on this computer that I'm posting from or I would post what I have so far

I have it so that it has read the page and put it in a string variable

Then it's just:

$SearchTerm = "This is an "
$String = "This is an example page"
If StringInStr($String, $SearchTerm) Then _
        $String = StringMid($String, StringInStr($String, $SearchTerm) + StringLen($SearchTerm))

MsgBox(64, "Result", '"' & $String & '"')

There's probably a slicker (read RegExp) way, but this works within my "AutoIt For Dummies" understanding.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

That works except I don't want to find "This is an example page"

I want it to find "This is" and then put "example page" into a variable

so that "example page" could change and it would still be able to copy that part

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