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?

Replies are listed 'Best First'.
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