On Nov 17, 2:30 pm, [EMAIL PROTECTED] (Peter Scott) wrote:
> On Sat, 17 Nov 2007 03:28:14 -0800, lcerneka wrote:
> > On Nov 16, 4:39 pm, [EMAIL PROTECTED] (Tom Phoenix) wrote:
> >> On 11/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >> > I get an html page with a 400 error code (Bad Request)
> >> > When asking for this page directly from a browser (Firefox or IE) it
> >> > works fine...
>
> >> This happens often enough that it is covered in the FAQ for WWW::Mechanize:
> [snip]
> > Thanks guys for tries and good link... but I still cannot figure it
> > out...  I tried to debug with use LWP::Debug qw(+) , and even tried to
> > extract the frame as a link with   my @frame_links = $mech-
> >>find_link( tag => "frame" )  as suggested in the Mechanize FAQ... but
> > they don't work... the result is always the same: 400 Bad request...
> > I'm a bit frustrated 'cause I often write code to data retrieval and
> > this is the first time such an error occurs... The  400 error code is
> > about malformed URL's syntax or request header... Any other idea?
>
> Show us your code, including the URL; or go to the libwww mailing list
> (http://lists.cpan.org/showlist.cgi?name=libwww) and show them; or hire an
> expert.
>
> --
> Peter Scotthttp://www.perlmedic.com/http://www.perldebugged.com/

Hi Peter,
here is the code:


#!/usr/bin/perl -w
use strict;
use warnings;
use WWW::Mechanize;

my $mech = WWW::Mechanize->new( agent => 'Mozilla 2.0.0.9' );

    $mech->get('http://www.aeroporto.fvg.it/tab/fmarrb.php');
my $arrivi = $mech->content;

print "Content-type: text/html\n\n";
print $arrivi;

exit;

As explained above, it cannot obtain the requested page... it receives
an html page with a 400 error Bad request...

Thanks for helping.


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


Reply via email to