smackdab has asked for the wisdom of the Perl Monks concerning the following question:
I get the search results, but can't figure out how to get the "song link"...any help is appreciated!!!use WWW::Mechanize; use URI::URL; use strict; use warnings; my $artist = 'The Beatles'; my $title = 'Hey Jude'; my $mech = WWW::Mechanize->new(); my $search = join("+", split(/ /, $artist)) . "+" . join("+", split(/ +/, $title)); print "search=$search\n"; $mech->get("http://search.lyrics.astraweb.com/?word=$search"); $mech->success() or die "Can't get the search page\n"; #print $mech->content(); #$mech->follow_link(url_regex=>qr/$title/i); $mech->follow_link(url_regex=>qr/hey jude/i); #$mech->follow_link(text=>"Hey Jude"); $mech->success() or die "Can't find song page\n"; print $mech->content();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: suck on www::mechanize question
by leira (Monk) on Mar 01, 2004 at 06:24 UTC | |
by smackdab (Pilgrim) on Mar 01, 2004 at 07:10 UTC | |
by leira (Monk) on Mar 01, 2004 at 07:33 UTC | |
by smackdab (Pilgrim) on Mar 01, 2004 at 22:13 UTC | |
by leira (Monk) on Mar 01, 2004 at 22:30 UTC | |
|
Re: suck on www::mechanize question
by Roger (Parson) on Mar 01, 2004 at 05:35 UTC | |
by smackdab (Pilgrim) on Mar 01, 2004 at 05:44 UTC | |
by Roger (Parson) on Mar 01, 2004 at 06:01 UTC | |
by smackdab (Pilgrim) on Mar 01, 2004 at 06:15 UTC |