Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

submitting nameless form using WWW::mechanize

by opensourcer (Monk)
on Jun 18, 2008 at 06:40 UTC ( [id://692634]=perlquestion: print w/replies, xml ) Need Help??

opensourcer has asked for the wisdom of the Perl Monks concerning the following question:

hi,

how can i submit a nameless form using WWW:Mechanize or in any other way?

-opensourcer
  • Comment on submitting nameless form using WWW::mechanize

Replies are listed 'Best First'.
Re: submitting nameless form using WWW::mechanize
by Corion (Patriarch) on Jun 18, 2008 at 06:49 UTC

    Submit it by number instead, like the synopsis of WWW::Mechanize shows:

    $mech->submit_form( form_number => 3, fields => { username => 'mungo', password => 'lost-and-alone', } );
      it's a nameless form <form> .... </form>
      i have checked for form number using $mech->forms()
      which displays nothing .
        "i have checked for form number using $mech->forms() which displays nothing."

        This might be due to JavaScript generated forms, which are really a pain in the ***. Try to look at the source through your preferred webbrowser and see what's going on there. If the form is there, without a name, indeed simply count them (and don't forget hidden forms ;-)

        --
        b10m

        Every form has a number. You start counting by 1 and increment the form number whenever a new form starts. Just try it:

        $mech->form_number(3); # selects the third form on the page $mech->submit; # submits the third form
        Count, you know 1, 2, 3, 4, 5 , 6, 7, 8, 9, 10, them select the form 3rd form on the page

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://692634]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found