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

Dear Monks -

Following my query last week I tried WWW:Mechanize and did find the documentation to be human-readable. However, I could not get the extraction of inputs or images to work in ActivePerl 5.8.8 on Windows XP. I used the following code:
#! /usr/bin/perl -w use strict; use WWW::Mechanize; my $mech = WWW::Mechanize -> new(); $mech -> get( 'http://www.merriam-webster.com/' ); for my $input ( $mech -> find_all_inputs() ) { printf $input -> name(), $input -> type(), "\n"; } for my $image ( $mech -> find_all_images() ) { printf "%-100s %s\n", $image -> image(), image -> tag(); }
I get error messages of the type
Can't locate object method "find_all_inputs" via package "WWW::Mechani +ze" at test.pl line ...

Any ideas why this is not working?

Thanks and regards -

Pat

Replies are listed 'Best First'.
Re: Failure of find_all_inputs and find_all_images in WWW::Mechanize
by Anonymous Monk on Aug 18, 2008 at 08:19 UTC
      or at least
      use WWW::Mechanize  1.24;

      These methods were added in this version.

        Pheeew ... that was easy. Thanks for the help, Anonymous Monk and hexcoder. The observed problem was indeed due to an older version of the module being installed on my machine. Updating the module to 1.30 under Linux fixed the problem.

        In my Windows package manager for Active Perl, however, the latest version for the Mechanize module is quoted as 0.72.
        Can anyone please advise how this version number relates to that of the module version for Linux? In case there semantics is identical ... can anybody elucidate why there are no more recent versions available for Active Perl?

        Thanks again for your help, everybody out there!

        Regards -

        Pat
Re: Failure of find_all_inputs and find_all_images in WWW::Mechanize
by Anonymous Monk on Aug 18, 2008 at 08:07 UTC
    no form