in reply to How do i save an image with www::mechanize
Grab the html:
perform a regex on $r to extract the url of the image, and then use either use Image::Magick or GD to save the image on your server.my $mech = WWW::Mechanize->new(); $mech->get($add); my $r = $mech->content;
$r =~ m#regex(.*)# my $imgurl = $1; my ($image, $x); my $photofile ="photo.jpg; $image = Image::Magick->new; $x = $image->Read($imgurl); $x = $image->Write("$photofile");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How do i save an image with www::mechanize
by Anonymous Monk on Jan 20, 2009 at 08:56 UTC | |
Re^2: How do i save an image with www::mechanize
by wilsond (Scribe) on Jan 20, 2009 at 08:20 UTC | |
by Anonymous Monk on Jan 20, 2009 at 08:50 UTC | |
by wilsond (Scribe) on Jan 21, 2009 at 19:18 UTC | |
Re^2: How do i save an image with www::mechanize
by missingthepoint (Friar) on Jan 21, 2009 at 01:50 UTC |
In Section
Seekers of Perl Wisdom