[Mechanize-users] Error getting url

samira khansha
Mon, 23 Feb 2009 14:36:46 -0000

I`m using wwwMechanize to download a list of urls,when I run this program,
when it is getting an url that doesn`t exist
it stops getting rest of urls , would you please tell me how can I solve
this problem?

use strict;
use WWW::Mechanize;
use File::Basename;
use HTML::Parser;
use Crypt::SSLeay;
#use LWP::Debug qw(+);
 open F,"urlList.txt" or die "I can not open it:$!";
 my $mech = WWW::Mechanize->new( autocheck => 1 );
 my @array = <F>;
 foreach my $link(@array){
        my $url = $link;
       $link =~ s/\///g;
       my $filename = $link;
       $mech->get( $url);
       $mech->save_content( $filename );

       print $filename."\n";
}


Best regards,
Samira Khonsha.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/mechanize-users/attachments/20090223/cb5262e1/attachment.html>