Guest User

Untitled

a guest
Apr 28th, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.57 KB | None | 0 0
  1. #!/usr/bin/env perl
  2.  
  3. use strict;
  4. use warnings;
  5. use utf8;
  6. use WWW::Mechanize;
  7. use vars qw(@links);
  8.  
  9.  
  10. my $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0' );
  11. for (my $i = 800; $i >= 0; $i -= 20) {
  12.     $mech->get("http://diary.ru/~narven-aegilwen?from=$i");
  13.     push @links, $mech->find_all_links(text => 'URL');
  14. }
  15.  
  16.  
  17. foreach my $link (@links) {
  18.     my $filename = $link->url_abs()->path();
  19.     $filename =~ s[/][];
  20.     $mech->get($link, ':content_file' => "E:\\diary\\$filename");
  21.     print $filename . "\n";
  22. }
Advertisement
Add Comment
Please, Sign In to add comment