in reply to Getting result page using WWW::Mechanize
Actually, you are getting two things here :
The message There is no form numbered 1 at /usr/pweb/phonekerala/cgi-bin/thisis.pl line 26 is a warning caused by the code :
$agent->form_number('1');WWW::Mechanize::Shell adds this code as a safety measure in case the first form is not automatically selected.
The most likely reason why you get that warning though is, that the first call to get did not return a valid page, this is why you can't set the values in the second try. Check this by adding a line like
orprint "Got the page ", $agent->content;
die $agent->res->as_string unless $agent->content;
I will implement a die_on_http_failure for WWW::Mechanize in one of the upcoming releases that will make the whole script die horribly if any http request fails - but don't hold your breath for that :-)
Mostly, this will implement the following idiom :
die $agent->res->as_string unless $agent->res->is_success;
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting result page using WWW::Mechanize
by Anonymous Monk on Jul 04, 2003 at 10:10 UTC | |
by Corion (Patriarch) on Jul 04, 2003 at 10:31 UTC | |
by Anonymous Monk on Jul 04, 2003 at 11:03 UTC | |
by Corion (Patriarch) on Jul 04, 2003 at 11:11 UTC | |
by Anonymous Monk on Jul 04, 2003 at 18:29 UTC | |
|