jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to get property details at the following url, and getting into a bit of a pickle!
I am trying to access a site where the image is clearly only allowed with the session cookie. I'm using Mechanize to grab the cookies and the image url:
my $mech = WWW::Mechanize->new( cookie_jar => { file => 'cookies.txt', ignore_discard => 1, autosave => 1 } ); $mech->get($add); my $r = $mech->content; my @names; my @links = $mech->find_all_images(url_regex => qr/jpg/); for my $img (@links) { my $a = $img -> url_abs; push @names, $a; }
I'm currently using getstore( ... ) from LWP::Simple to write the image to file
I have tried using LWP::Useragent, $ua->mirror( $url, $filename ) after loading the cookie file: $ua -> cookie_jar('cookies.txt');, however this has not worked and the photo files are not recreated. If anyone can give me some pointers on how to do this I'd be very grateful.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Overcoming image lock WWW::Mechanize
by Corion (Patriarch) on Feb 13, 2009 at 11:45 UTC | |
by jonnyfolk (Vicar) on Feb 13, 2009 at 11:56 UTC |
Back to
Seekers of Perl Wisdom