How to capture info on a webpage

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
fthomas
Pro Scripter
Posts: 91
Joined: Fri Oct 03, 2008 6:40 pm

How to capture info on a webpage

Post by fthomas » Mon Nov 09, 2009 10:57 pm

Forgive my ignorance on this one, but I'm trying to create a script to automate repetitive functions within a web page and I can do quite a bit with webrecorder, but I do get stuck at times. For example, I'd like to be able to download and display an image on the current page in a dialog box for confirmation of an action.

So I'd need to pull the information from the page, by recognizing it's placement in the web page text. Then, have the script pull up a copy of the data or image into a dialog box.

Can I do this?

Thanks!

Frank

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Nov 10, 2009 11:43 am

For just text use the tag extraction tool.

For an image you would need to use the tag extraction tool to return the html of the tag and then you would be able to parse out the image location. It would then probably be easiest to use HTTPRequest to retrieve that image to a file.

If you want/need more control you can parse the entire document HTML yourself.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

fthomas
Pro Scripter
Posts: 91
Joined: Fri Oct 03, 2008 6:40 pm

Thanks Marcus,

Post by fthomas » Tue Nov 10, 2009 3:28 pm

I knew it could be done, but not sure how. Do you have any examples of this to allow me a template to work from?

First how to parse out the whole html document (and tags would be very cool).

Second, how to do a http call again for the image? I did find out how to get the image again from the code if I modify the text.


Frank

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Thu Nov 12, 2009 10:18 pm

i would suggest using macro schedulers image rocognition if you want to have it be able to detect image when it appears that what i do for game cheating alot
here is link for tutorial video on how to use it


http://www.mjtnet.com/demos/irdemo.html
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

fthomas
Pro Scripter
Posts: 91
Joined: Fri Oct 03, 2008 6:40 pm

Post by fthomas » Wed Dec 23, 2009 7:09 pm

mtettmar wrote:For just text use the tag extraction tool.

For an image you would need to use the tag extraction tool to return the html of the tag and then you would be able to parse out the image location. It would then probably be easiest to use HTTPRequest to retrieve that image to a file.

If you want/need more control you can parse the entire document HTML yourself.
Thanks for the graphics reply idiot, but I really would like more information on the 'tag extraction tool' and what else mtettmar mentioned here please.

Frank

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts