WebRecorder to capture name of image on website

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
GarryP
Junior Coder
Posts: 27
Joined: Sat Feb 04, 2006 12:01 pm

WebRecorder to capture name of image on website

Post by GarryP » Thu Nov 22, 2007 1:33 am

I am new to webrecorder, so please bear with me, I am sure I am missing something simple. On a vendor website, TD50 is a date and time of posting, TD51 is a dollar amount, TD52 is a total number of items in file, TD53 has IMG10. There are multiple rows following the same pattern, what I am trying to accomplish is: the image is TD53 is named YesNoTrue.gif or YesNoFalse.gif which of course are pictures of Yes or No, I want to read the name of that file, and if it is YesNoFalse.gif I know I have not yet downloaded the data, so I download it. Else move to the next row and check again. I have the entire process working fine except I cannot figure out how to find out if I have previously downloaded.

I would like to either determine the filename of the image, or actually save the image then validate it.

Thanks

GarryP
Junior Coder
Posts: 27
Joined: Sat Feb 04, 2006 12:01 pm

Basic Question

Post by GarryP » Thu Nov 22, 2007 5:37 am

How can I save the google image from http://www.google.com If I can get that, I should be able to work my to what I am looking for.

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

Post by Marcus Tettmar » Thu Nov 22, 2007 8:51 am

This gets the image tag from Google:

Code: Select all

// Generated by MacroScript WebRecorder 2.0
// Recorded on  Thursday, November 22, 2007, at 08:46 AM

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
IE_Create>0,IE[1]

IE_Navigate>%IE[1]%,www.google.com,r
IE_Wait>%IE[1]%,r
Wait>delay

//Modify buffer size if required ...
Let>IMG0_SIZE=4098
IE_ExtractTag>%IE[1]%,,IMG,0,1,IMG0,r
MidStr>r_6,1,r,IMG0
MessageModal>IMG0

LibFree>hIE
Label>end_script
If this were from your vendor website you could then do your logic could be something like:

Pos>YesNoTrue.gif,IMG0,1,pYN
If>pYN>0
//image is YesNoTrue
Else
//image is YesNoFalse
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

GarryP
Junior Coder
Posts: 27
Joined: Sat Feb 04, 2006 12:01 pm

Works perfectly

Post by GarryP » Thu Nov 22, 2007 2:54 pm

Thank you, this works perfectly for me now. Not sure what my thought process was that I missed that one, but again I defer to your knowledge and a superb product.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Thu Nov 22, 2007 6:38 pm

Hi Marcus,

The following commands...

IE_Create>0,IE[1]
IE_Navigate>%IE[1]%,www.google.com,r
IE_Wait>%IE[1]%,r
IE_ExtractTag>%

...are not recognized by Macro Scheduler Pro ver 9.2.01 which is the latest version.

I haven't been keeping up with advances in Webrecorder... but I thought all code it generates would be runnable/editable/recognized by Macro Scheduler... at least I think it was this way in the past.

Have things changed or will these new "Webrecorder commands?" soon be recognized by the Macro Scheduler product as well?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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

Post by Marcus Tettmar » Thu Nov 22, 2007 7:06 pm

Those are WebRecorder commands - part of the WebRecorder library. You need WebRecorder to use them.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

redrabbit
Newbie
Posts: 1
Joined: Sat Jan 17, 2009 8:27 pm
Location: USA

Post by redrabbit » Sat Jan 17, 2009 8:35 pm

mtettmar wrote:This gets the image tag from Google:

Code: Select all

// Generated by MacroScript WebRecorder 2.0
// Recorded on  Thursday, November 22, 2007, at 08:46 AM

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
IE_Create>0,IE[1]

IE_Navigate>%IE[1]%,www.google.com,r
IE_Wait>%IE[1]%,r
Wait>delay

//Modify buffer size if required ...
Let>IMG0_SIZE=4098
IE_ExtractTag>%IE[1]%,,IMG,0,1,IMG0,r
MidStr>r_6,1,r,IMG0
MessageModal>IMG0

LibFree>hIE
Label>end_script
If this were from your vendor website you could then do your logic could be something like:

Pos>YesNoTrue.gif,IMG0,1,pYN
If>pYN>0
//image is YesNoTrue
Else
//image is YesNoFalse
Endif
Hi!
How to save this image in c:\Downloads\image.png. Help me plese!!!

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