#!c:\\perl\\bin use LWP::Debug qw(+); use strict; use WWW::Mechanize; use HTTP::Cookies; use MIME::Base64; my $outfile = "out.txt"; #my $url = "http://mylink/blah/"; my $username = "username"; my $password = "password"; my $mech = WWW::Mechanize->new(); my @args = (Authorization => "Basic " .MIME::Base64::encode('USER:PASS')); $mech->get('http://mylink/blah/', @args); $mech->credentials($username,$password); $mech->click(); my $output_page = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE);