Hi All, I am currently automating some UI tests with the help of WWW::Mechanize module.
I need to save images on a webpage. I tried using the find_image function to get the reference of the image ( as shown in the script below ). But do not understand how I can save that image in a file. Kindly help! ------------------------------------- My program: ------------------------------------- #!/usr/local/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->quiet(0); #turn on warnings my $host = "abc.xyz.com"; my $url = "http://$host/email"; $mech->get($url); my $imageref = $mech->find_image( url_regex => qr/gen_login_logo/ ); if ( $mech->success ) { print "Found the image, reference is : $imageref\n"; } else { print "Did not find the image\n"; } ------------------------------------ The Output: ------------------------------------ -bash-2.05b$ ./save_images.pl Found the image, reference is : WWW::Mechanize::Image=HASH(0x850d024) Thanks, Dhanashri