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
In reply to Re^8: Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
by ajose
in thread Not able to select the form with WWW::Mechanize::Firefox using form_with_fields()
by ajose
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |