I am trying to parse a https file using perl.
When i run the program below I get the error:
Error: 500 Connect failed: connect: Unknown error;
Also how can i change the $ua->agent('Mozilla/5.0'); to take the microsoft xp browser?
#!/usr/local/bin/perl
$ENV{"HTTP_PROXY"} = "http://http-proxy:xx";
$ENV{"HTTP_PROXY_USER"} = "xxxx";
$ENV{"HTTP_PROXY_PASS"} = "xxxx";
use LWP::UserAgent;
use XML::RSS;
$ua = LWP::UserAgent->new;
$req = HTTP::Request->new(GET=> 'https://www.paypal.com/');
$ua->env_proxy();
$ua->agent('Mozilla/5.0');
$res = $ua->request($req);
if ($res->is_success) {
#print ($res->content);
printf "fetched %d bytes\n", length($res->content);
} else {
print "Error: " . $res->code . " " . $res->message;
}
Thank you
Akhila