ghenry has asked for the wisdom of the Perl Monks concerning the following question:
Dear Master Monks,
I have a form that has this on it:
which is the only thing to click. How can I get Mech to submit the form?<input type=image src="/images/buttons/login.gif" alt="Login">
mech-dump gives:
login= (text) pass= (password) secure_login=0 (radio) [1/SSL |*0/Non-SSL] <NONAME>=<UNDEF> (image)
So far I have:
# Fields to fill out, since there is only one button, # try to let Mech find it $mech->submit_form( form_name => 'loginForm', fields => { login => $user, pass => $passwd, secure_login => '0', }, )->is_success() || die "Unable to login to $login_page, stopped"; # Ensure we've logged in successfully my $logout = $mech->find_link( text => "Logout" ); die "Did not log in, stopped" unless $logout;
Now I get the message about "Did not log in", so maybe my find_link() is incorrect?
In the click(), it says:
So that's what I have done. Is that right?If there is only one button on the form, $mech->click() with no argume +nts simply clicks that one button.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize - Image used as button with no name?
by Roy Johnson (Monsignor) on Dec 06, 2005 at 18:08 UTC | |
|
Re: WWW::Mechanize - Image used as button with no name?
by planetscape (Chancellor) on Dec 07, 2005 at 02:01 UTC |