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

Re: Re: WWW:Mechanize and Windows

by Akira71 (Scribe)
on Aug 12, 2003 at 18:31 UTC ( [id://283295]=note: print w/replies, xml ) Need Help??


in reply to Re: WWW:Mechanize and Windows
in thread WWW:Mechanize and Windows

Hello John, Well all the examples cause the problem from the example.pod file. Here is the shortest one, written by Randal himself. I was running this code to test the module out and that is when I ran into the problem. In other words, I have not even gotten to my own code yet. I have also been unsuccesfull in getting the latest version of this module to install which is why I went to the prior version.
use strict; $|++; use WWW::Mechanize; use File::Basename; my $m = WWW::Mechanize->new; $m->get("http://www.despair.com/indem.html"); my @top_links = @{$m->links}; for my $top_link_num (0..$#top_links) { next unless $top_links[$top_link_num][0] =~ /^http:/; $m->follow($top_link_num) or die "can't follow $top_link_num"; print $m->uri, "\n"; for my $image (grep m{^http://store4}, map $_->[0], @{$m->links}) { my $local = basename $image; print " $image...", $m->mirror($image, $local)->message, "\n" } $m->back or die "can't go back"; }

This is the very line that causes it:
my $m = WWW::Mechanize->new;

Well any help is always appreciated. Thank you very much!

Akira

Replies are listed 'Best First'.
Re: WWW:Mechanize and Windows
by WhiteBird (Hermit) on Aug 13, 2003 at 00:30 UTC
    Using Windows 2000, ActiveState perl v5.6.1 and WWW::Mechanize (version 0.43)-- I cut and pasted your code and it runs perfectly on my system. So, perhaps the problem is in your version of Mechanize, or perhaps you're missing something else on your system. When I run the code through my debugger, it does tap into LWP::UserAgent. Could you have a problem there? (Seems unlikely, but leave no stone unturned.)

    I know this isn't much help. But don't give up hope, the code can work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found