Trouble getting site
John W Cunningham (john@pickaprof.com)
Wed, 21 Mar 2001 22:00:56 -0600
Hello all,
I'm having trouble pulling a certain site. Ordinarily this script works
perfectly, but it just doesn't want to retrieve this site. What am I doing
wrong?
Thanks!
-John
print &WWWget("http://registrar.ucdavis.edu/CSRD/spring2001/(AAS).html");
sub WWWget {
# Create a user agent object
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt" .
$ua->agent);
#Timeout
my $timeout = 10000;
# Create a request
my $req = new HTTP::Request GET => $_[0];
$req->content_type('application/x-www-form-urlencoded');
$req->content('match=www&errors=0');
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
return($res->content);
print(".");
}else{
print("Mine Error - ",$_[0],"\n");
}
}