Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: WWW::Mechanize 1.04 for Windows

by dws (Chancellor)
on Nov 26, 2004 at 18:00 UTC ( [id://410610]=note: print w/replies, xml ) Need Help??


in reply to WWW::Mechanize 1.04 for Windows

Get the .tar.gz of WWW::Mechanize from here and unzip it into c:\perl\site\lib\WWW\ and you're off and running. It'll install more than you need, but you can trim off the test files and extraneous stuff.

Replies are listed 'Best First'.
Re^2: WWW::Mechanize 1.04 for Windows
by New Novice (Sexton) on Nov 26, 2004 at 18:37 UTC
    That'S what I did. But when I run a programme (see below) that uses the uri-routine, I get the following response: "Can't locate object method uri via WWW::Mechanize::Link". Furthermore, 9 tests and 14 subtests of nmake test were skipped.
    #!/usr/bin/perl -w use strict; use WWW::Mechanize; my $agent = WWW::Mechanize->new(); $agent->get("http://europa.eu.int/prelex/rech_avancee.cfm?CL=en"); die "Can't even get the home page: ", $agent->response->status_line un +less $agent->success; $agent->form(2); $agent->field("clef2", "1999"); $agent->field("clef1", 'COM'); $agent->field("nbr_element", '99'); $agent->click(); my $input=$agent->content(); my @links = grep { $_->uri =~ m!liste_resultats! } $agent->links; foreach my $link (@links) { print "Retrieving $link\n"; $agent->follow( $link ); print $agent->content; $agent->back; };

      And a very appropriate response it is, seeing as how WWW::Mechanize::Link has methods named url and URI, but none named uri.

      WWW::Mechanize::Link pod

      Why do you think installation of WWW::Mechanize failed? The error you encounter is a runtime error at line 13 of your script. That implies that all the calls to that module above it, have actually succeeded — or at least, not made the module barf. Heck, even the $agent->links call, on the right of your grep block, must have returned some values or you wouldn't have gotten this far.

      And ikegami pinpointed the cause of your problem. A non-existing method name, that's a runtime error, as methods can even be created (by AUTOLOAD) on the fly.

      Conclusion: unless the exact same script works on another computer, and I sincerely doubt that, the module most likely will have been properly installed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-25 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found