Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

submitting nameless form using WWW::mechanize

by opensourcer (Monk)
on Jun 18, 2008 at 06:40 UTC ( #692634=perlquestion: print w/replies, xml ) Need Help??
opensourcer has asked for the wisdom of the Perl Monks concerning the following question:


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

  • Comment on submitting nameless form using WWW::mechanize

Replies are listed 'Best First'.
Re: submitting nameless form using WWW::mechanize
by Corion (Pope) 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 ;-)


        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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://692634]
Approved by Corion
[erix]: yeah... trepidation
Corion quivers with antici...
[choroba]: if you turn off autocommit and run a prepared statement which fails, the transaction is automatically rolled back, at least in DBD::Pg
[erix]: at least, I'll know where to find the documentation :P
[choroba]: but if there's no prepared statement, there's no rollback
[choroba]: the rollback happens when deallocating the prepared statement in error state.
[choroba]: is this something that Pg enforces, or just a consequence of the Perl implementation?
[choroba]: also, does it make any sense? We run different statements generated from input structures, sometimes prepared statements are involved, sometimes not. We want the behaviour to be consistent.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-09-19 12:58 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (220 votes). Check out past polls.