in reply to Re^7: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
in thread Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
Both these error messages including "4 elements found for form number 1" leads to quit the program based on the value of the parameter autodie which is set to 1 by default.
Even if I turned off autodie, the value function does not return the present value when the error is "4 elements found for form number 1". Please see below for the code snippet and output for the same:
Output:my $input_name = 'DMPName'; my $web_url = 'http://xxx.xxx.xx.xx/config.asp'; my $mech = WWW::Mechanize::Firefox->new(activate => 0, autoclose => 1, autodie =>0); $mech->get($web_url, no_cache => 1); $current_form = $mech->form_number(1); print "Present value of $input_name: " . $mech->value($input_name) . " +\n";
But interestingly while selected the form 10 which is not existing, I got following output:4 elements found for form number 1 at ..... No elements found for input with name 'DMPName' at .... Present value of DMPName:
$current_form = $mech->form_number(10);
No elements found for form number 10 at ... Present value of DMPName: Current Name
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
by Corion (Patriarch) on Jun 28, 2011 at 16:08 UTC | |
by ajose (Acolyte) on Jun 30, 2011 at 15:26 UTC | |
by Corion (Patriarch) on Jun 30, 2011 at 16:28 UTC | |
by ajose (Acolyte) on Jun 30, 2011 at 18:09 UTC |