W
Winston75
hi,
no errors in my code, but not downloaded file on my disk .
getstore ($url, $filename) not working? i don't know, any ideas?
thanks,
#!/usr/bin/perl -w
use strict;
use warnings;
use LWP::UserAgent;
use LWP::Simple;
use HTML::SimpleLinkExtor;
my $base='https://username:[email protected]/index.html';
my $ua = LWP::UserAgent->new(agent => 'Mozilla/4.73 [en] (X11; I;
Linux 2.2.16 i686; Nav)' );
my $req = HTTP::Request->new( GET => "${base}" );
my $res = $ua->request($req);
die $res->status_line
if not $res->is_success;
my $extractor = HTML::SimpleLinkExtor->new(); $extractor->parse($res-
my @allLinks = $extractor->links;
for (@allLinks)
{
if (/zip/)
{
my $url="https://www.mysite.com/index.html/$_";
my (@tab)=split / \ / /;
my $fileName = $tab[1];
print "downloading $fileName....";
getstore($url, $fileName);
print "Done !\n";
}
}
exit(0);
no errors in my code, but not downloaded file on my disk .
getstore ($url, $filename) not working? i don't know, any ideas?
thanks,
#!/usr/bin/perl -w
use strict;
use warnings;
use LWP::UserAgent;
use LWP::Simple;
use HTML::SimpleLinkExtor;
my $base='https://username:[email protected]/index.html';
my $ua = LWP::UserAgent->new(agent => 'Mozilla/4.73 [en] (X11; I;
Linux 2.2.16 i686; Nav)' );
my $req = HTTP::Request->new( GET => "${base}" );
my $res = $ua->request($req);
die $res->status_line
if not $res->is_success;
my $extractor = HTML::SimpleLinkExtor->new(); $extractor->parse($res-
content);
my @allLinks = $extractor->links;
for (@allLinks)
{
if (/zip/)
{
my $url="https://www.mysite.com/index.html/$_";
my (@tab)=split / \ / /;
my $fileName = $tab[1];
print "downloading $fileName....";
getstore($url, $fileName);
print "Done !\n";
}
}
exit(0);