Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Web Scraper : 2 process !!

by jeffa (Bishop)
on Apr 17, 2015 at 16:47 UTC ( [id://1123789]=note: print w/replies, xml ) Need Help??


in reply to Web Scraper : 2 process !!

You are very close but you are restricting your "rules" a bit too much. Try "relaxing" what you tell Web::Scraper to expect. To prevent hitting the site too much, I saved the output into a file named lee-morgan.html. I've taken care of scraping out the release date and the bio paragraphs, let's see if you can obtain the rest. :)

use strict; use warnings; use Data::Dumper; use Web::Scraper; open FH, 'lee-morgan.html' or die $!; my $data = do{ local $/; <FH> }; close FH; my $artists = scraper { process '.release-height > p', 'bio[]' => 'TEXT'; process '.recording-dates > h3', date => 'TEXT'; }; my $res = $artists->scrape( $data ); print Dumper $res;

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1123789]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2024-04-23 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found