0

This is the button I want to click:

<input type="submit" value="Continue">

As you see it has no name at all to specify the order on it. I am using the WWW::Mechanize module. I tried $agent->submit();, but it seems to not do the job, any help please?

daxim
  • 39,270
  • 4
  • 65
  • 132
Hady Saker
  • 21
  • 1
  • Where is the button you are talking about? Is this a real question? – Jean Mar 23 '13 at 23:11
  • Read the docs. "Submits the page, without specifying a button to click. Actually, no button is clicked at all." Try 'click_button(value)' instead. – Jim Black Mar 23 '13 at 23:26
  • 2
    This is a perfectly legit question regarding WWW::Mech's form-submission functionality. Voting to reopen. – ikegami Mar 24 '13 at 01:18
  • 2
    Yep this question should be re-opened. I can't believe 5 people closed what is an obvious question - trying to use the WWW::Mechanize module to do the same as a browser does when you click on the HTML input button... We need to down vote the closer clowns. – Myforwik Mar 24 '13 at 03:32
  • 1
    people are sheep; vote any arbitrary recent question for closing and you'll get 4 followers regardless of merit – ysth Mar 24 '13 at 04:10
  • 2
    omg this is 100% legit question I am not so good with perl.The button has no name maybe its an easy question instead answer me instead of closing. – Hady Saker Mar 24 '13 at 05:58
  • Tried $mech->click_button(Continue); like someone asked and its not working. – Hady Saker Mar 24 '13 at 06:01

1 Answers1

1

It is not necessary to explicitely click the button to submit a form, let Mechanize handle it implicitly:

$mech->submit_form(
    with_fields => {
        username => 'foobar',
        password => '12345678',
    }
);

Run mech-dump to see the relevant form input field names, for instance here in my example username and password.

daxim
  • 39,270
  • 4
  • 65
  • 132