http://www.perlmonks.org?node_id=805214

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

I am using this module to fetch the web pages. At one stage I struggled to get the form details which is there inside the tag.

How can I get it?

My actual requirement is to click the button inside the form. But the form is inside the table. When I was using forms() method it returns empty array. I also tried with click_button() method this tells an error as "Can't call method "click" on an undefined value at /usr/share/perl5/WWW/Mechanize.pm line 1403".

Replies are listed 'Best First'.
Re: Need Help in WWW::Mechanize module
by marto (Cardinal) on Nov 05, 2009 at 10:21 UTC
Re: Need Help in WWW::Mechanize module
by redgreen (Priest) on Nov 05, 2009 at 14:17 UTC

    Try using mech-dump to debug the form. It will show you what forms are available and what data they expect.

    If mech-dump doesn't see any forms, then you might have to view the page source. It is possible the form is built with javascript, which isn't handled by mech.

Re: Need Help in WWW::Mechanize module
by Anonymous Monk on Nov 06, 2009 at 09:05 UTC