All pastes #933139 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-08 03:31 UTC
rendered paste body
/usr/bin/perl

 use WWW::Mechanize;

 my $start_url = "http://blah.com/";
 my $mech = WWW::Mechanize->new(agent => "Linux Mozilla");

 $mech->get($start_url);
 @urls = $mech->links;

 while(defined ($next = $mech->find_link( text=> 'Next >' ))) {
   foreach $a (@urls) {
      $url=$a->url;
         if($url =~ /video-/) {
            print $url."\n";
         }
   }
   $n_url = $next->url;
   $mech->get("$start_url"."$n_url");
 }