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

Howdy monks. I am trying to get a Mech script to click a button. I could swear I'm doing it according to docs, i.e.
use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $url = 'http://locks.asu.edu/rdltest.htm'; $mech->get($url); my $inputobject = $mech->current_form()->find_input('dl.start',undef,1 +); my $response = $mech->click_button(input => $inputobject);
But when I run this I get error Can't locate object method "click_button" via package "WWW::Mechanize"

I have tried it with argument value => 'SERVER1' also and it's the same error. What am I doing wrong?

Thx...Steve

(btw, a successful click won't do anything; just testing the click function so far)

Replies are listed 'Best First'.
Re: WWW::Mechanize click_button method not found
by bradenshep (Beadle) on Nov 11, 2006 at 02:40 UTC
    Run the one-liner: perl -MWWW::Mechanize -e 'print $WWW::Mechanize::VERSION."\n"' to check your WWW::Mech version. It runs fine using my 1.20. Perhaps your version is too old to include this method? Try using one of the submit() or click() methods instead, if this method really doesn't exist.
      Indeed I had an outdated version of Mechanize installed. Many thanks!