Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: Submitting a second form

by rp132 (Initiate)
on Jul 21, 2013 at 16:37 UTC ( #1045519=note: print w/replies, xml ) Need Help??

in reply to Re: Submitting a second form
in thread Submitting a second form

I tried the example you gave and thought that it may work, but I get the error "There is no form with the requested fields".

Replies are listed 'Best First'.
Re^3: Submitting a second form
by PerlSufi (Friar) on Jul 21, 2013 at 17:09 UTC
    Hello, I would recommend getting the firefox add-on Firebug, inspect the page for the form's name in the HTML, and add it that way. for example:
    $mech->submit_form ( form_name => 'form', fields => { modem => '1122.3344.5566', ip_select => ''} );
    In fact, looking at your code again to give you that example, problems may have been caused by not separating the field names with a comma? But I'm not sure.. see if that works for you, though..
Re^3: Submitting a second form
by Khen1950fx (Canon) on Jul 21, 2013 at 19:19 UTC
    Actually, it's not an error. There is no form with the requested fields. Is the url correct? Any syntax problems? Try this:
    #!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $url = ''; my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->get($url); my(%fields) = ( modem => '1122.3344.5566', ip_select => '', ); my $result = $mech->submit_form( with_fields => %fields, ); print $result;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045519]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2018-02-21 04:19 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.