P
Paul
hi, there,
I am using perl to access specified web pages. this is my code. when I
run the code, I get the following error: 302 Found. I checked and knew
this is because of redirect.
Would you guys tell me how to solve this problem?
thanks.
paul.
use LWP 5.64;
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Cookies;
$lurl='http://www.abcddefg.com';
$lbrowser = LWP::UserAgent->new;
$lbrowser->timeout(5);
$lcookie_jar = HTTP::Cookies->new;
$lreq = new HTTP::Request('GET',$lurl);
$lresponse = $lbrowser->simple_request($lreq);
$lcookie_jar->extract_cookies($response);
if ($lresponse->is_success)
{
print "OK. connected with server\n"
}
else
{
print "Error1: when get $lurl:\t" . $lresponse->status_line . "\n";
}
I am using perl to access specified web pages. this is my code. when I
run the code, I get the following error: 302 Found. I checked and knew
this is because of redirect.
Would you guys tell me how to solve this problem?
thanks.
paul.
use LWP 5.64;
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Cookies;
$lurl='http://www.abcddefg.com';
$lbrowser = LWP::UserAgent->new;
$lbrowser->timeout(5);
$lcookie_jar = HTTP::Cookies->new;
$lreq = new HTTP::Request('GET',$lurl);
$lresponse = $lbrowser->simple_request($lreq);
$lcookie_jar->extract_cookies($response);
if ($lresponse->is_success)
{
print "OK. connected with server\n"
}
else
{
print "Error1: when get $lurl:\t" . $lresponse->status_line . "\n";
}