in reply to Page Scraping
use strict; use warnings; use Fatal qw/ open close /; use WWW::Mechanize; use Carp; my $mech = WWW::Mechanize->new( autocheck => 1 ); open my $pro_list, '>>', 'profiles.out'; for my $curr_page (1..3) { $mech->get("http://indiecharts.com/indie_Music_Artists.asp?Key +word=&Page=$curr_page&butname="); my @artist_links = $mech->find_all_links(url_regex => qr/\d{9} +/); print scalar @artist_links, " matching links on page $curr_pag +e\n"; for my $artist_link (@artist_links) { print $pro_list $artist_link->text(), "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Page Scraping
by 80degreez (Initiate) on May 01, 2007 at 21:14 UTC | |
by akho (Hermit) on May 01, 2007 at 21:18 UTC | |
by shigetsu (Hermit) on May 01, 2007 at 21:36 UTC | |
by akho (Hermit) on May 02, 2007 at 08:19 UTC |