I'm hoping that someone can help me with a problem I'm having.  I'm still
pretty new at this and have difficulty in following much of what is
discussed on the listserv.  I have a script that has always allowed me to
get data from a public web site.  Now I can't seem to pull the data, even
though I can go to the web site by browser.
Here is my code:
$url="";
$Data="";
$secs=7200;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Status;
use HTTP::Response;
use LWP::Protocol;
use LWP::Authen::Basic;
use LWP::Simple;


$url="http://www.sce.com/esp/Dlf/F2002.dlf";;

$user_agent=new LWP::UserAgent;
$user_agent->timeout([$secs]);
$request=new HTTP::Request("GET","${url}");
$response=$user_agent->request($request);

if ($response->is_success)
{

     open(OUTPUT, ">testsceweb" ) or  die("Can't open the output file
testsceweb $!\n");
     print OUTPUT $response->{_content};
     close OUTPUT;
}
else
{
     die "Fetch of SCE failed: ", $response->status_line;
}

The response is :  403 Access Forbidden

Why would I get this at a public site?  (Also, I'm struggling in trying to
get a grasp on the materials related to LWP (e.g., cookbook).  I thank God
for documentation like cookbook, but I'd like to get a more in-depth
understanding of the subject.  Is there something I can study to get up to
speed?  Any recommendations would be appreciated.)

Thanks,
Greg
CSC

Reply via email to