#!perl.exe use strict; use WWW::Mechanize; use HTTP::Cookies; use LWP; use LWP::DebugFile; require HTTP::Request; my $cookie_jar = HTTP::Cookies->new( file => 'cookies.dat', autosave => 1, hide_cookie2 => 1 ); my $bot = WWW::Mechanize->new; $bot->max_redirect(100); $bot->cookie_jar($cookie_jar); $bot->proxy('http', 'http://proxy.company.com:80/'); $bot->proxy('https', 'http://proxy.company.com:443/'); $bot->no_proxy('localhost', 'company.com'); $bot->credentials('DOMAIN\user','pwd'); $bot->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3'); my $x = 0; foreach $x (1..15) { my $url = "http://www.website.com/image$x.jpg"; print "Processing: $url\n"; my $response = $bot->get($url); my $content = $bot->content; open F, ">image$x.jpg"; print F $content; close F; }