DB> I am currently automating some UI tests with the help of WWW::Mechanize
DB> module.
DB> I need to save images on a webpage.
DB>     print "Found the image, reference is : $imageref\n";

>>>>if you have URL in $imageref, what is problem with saving ?
>>>>$mech->get($imageref);

>>>>and save_contents() aka you'll sure find in Mechanize module.

If I do as you have mentioned above, $mech-success is False. ( $mech->get
expects a url )


I tried to get the complete the URL by concatenating the $imageref->base and
$imageref->url. And then issue get on this complete url. ( added the code
below )
----------------
my $imageurl = $imageref->url ;
my $imagebase = $imageref->base ;
$url = "$imagebase/$imageurl";
print "Getting url $url\n";
$mech->get($url);
----------------
And heres the output:
-bash-2.05b$ ./save_images.pl
Found the image, reference is : WWW::Mechanize::Image=HASH(0x850cb48)
Getting url http://abc.xyz.com/em/images/eui/gen_login_logo.gif
Unable to find document
------------------------

I do see the image manually using IE and can save it. What I want to do is,
emulate this behavior, Open the page in IE, right click on the image and
select "save picture as" and save it.


Thanks,
Dhanashri





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to