Seeing that there are only two buttons in your form, the ysth clause should be easy to implement.
use strict; use warnings; use WWW::Mechanize; my $username = "suezy"; my $password = "123"; my $url = 'http://.../sample.cgi'; my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->credentials($username,$password);
And then:
$mech->click_button({number => 1});
Or:
$mech->click_button({number => 2});
The case of trial and error is more than enough to find out which button you click.
EDIT
I assume that the appropriate form is already selected. If not:
$mech->form_number($formNumber);
where $formNumber is the form number on the page in question.
Zaid
source share