Prabu Ayyappan wrote:
> Hi Siva,
>
> Leave the perl script and first try the url in your browser. 
>
> If it works fine means then the code will get you the HTML contecnt of that 
> page.
>
> Thanks and Regards,
> Prabu.M.A
>   
If you end up able to reach the URL from a browser and somehow not from
the script (worked for me) and this isn't a process that needs to be
repeated, you could also just save the generated HTML page from within
your browser and then parse the local copy from your script (use a
file:// URI).

If it's a process that is repeated then you may want to try narrowing
the problem down to a more specific step. 
> ----- Original Message ----
> From: Siva Prasad <[EMAIL PROTECTED]>
> To: beginners@perl.org
> Sent: Wednesday, October 24, 2007 11:18:21 AM
> Subject: PArsing tables of web page directly on the web.
>
>  
> Hi Gurus,
>  
> I wanted to parse a PHP page which is on web.
>  
> I don’t have access to server where the PHP page is hosted.
>  
> So I wanted to get source of that particular page and then parse the source 
> file.
>  
> Here is the code:
>  
> -----------Code
> use LWP::UserAgent ; 
> $ua = new LWP::UserAgent ; 
> $ua->agent("Mozilla/4.0") ; # Play with their minds 
> $req = new HTTP::Request 'GET', 'http://www.jimmyr.com:80/free_education.php' 
> ; 
> $req->header('Accept' => 'text/html') ; 
> $res = $ua->request($req) ; 
> if($res->is_success){ 
>         print $res->content ; 
>         } else { 
>         print "Error: " . $res->code ." ". $res->message ; 
>         } 
>  
> -------------Code
>  
>  
> But When I run the above code I am getting the following error.
>  
> Error: 500 Can't connect to www.jimmyr.com:80 (connect: Unknown error).
>  
>  
> Is there any alternate way that I can directly parse tables and contents of 
> the tables on the webpage directly?
>  
>  
> Thanks in Advance,
> Siva
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>   


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to