Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Can't call method "click" on an undefined value

by ikegami (Pope)
on Jun 01, 2008 at 03:41 UTC ( #689498=note: print w/replies, xml ) Need Help??


in reply to Can't call method "click" on an undefined value

Note that the error is origination from within WWW::Mechanize. It's not $mech that's undefined. WWW::Mechanize::click in turns calls the method click of another object.

The problem is that WWW::Mechanize doesn't find the button you want it to find but proceeds to try to click it anyway. According to the docs,

The first argument is the name of the button to be clicked

The document doesn't contain any buttons named Save/Reboot. You'd be better off using a method that can locate a button by value, such as click_button.

$mech->click_button( value => $button );

Replies are listed 'Best First'.
Re^2: Can't call method "click" on an undefined value
by Anonymous Monk on Jun 01, 2008 at 04:08 UTC
    Actually, its because he hasn't selected a form (form_name form_number), and since there are no forms on the page

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://689498]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2021-10-27 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (91 votes). Check out past polls.

    Notices?