Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How to write CSS selector to extract more than one value from html source using scrappy module?

by Anonymous Monk
on May 16, 2011 at 12:05 UTC ( #905052=note: print w/ replies, xml ) Need Help??


in reply to How to write CSS selector to extract more than one value from html source using scrappy module?

But I need a single CSS selector to extract both href

No, you absolutely do not need a single CSS selector


Comment on Re: How to write CSS selector to extract more than one value from html source using scrappy module?
Re^2: How to write CSS selector to extract more than one value from html source using scrappy module?
by Anonymous Monk on May 16, 2011 at 13:13 UTC
    Based on the Scrappy synopsis you might use
    $scraper->crawl( 'http://www.example.com/page', '/page' => { 'div p a' => sub { print $_[1]->{href}, "\n"; }, 'div p img' => sub { print $_[1]->{src}, "\n"; } } );
    the selectors are made in turn, not that useful

    Scrappy::Scraper::Parser further convinces me Scrappy has too much Pee.

    Pure Web::Scraper looks simpler to manage

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-10-24 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (133 votes), past polls