nysus has asked for the wisdom of the Perl Monks concerning the following question:

I've been staring a this for an hour now and I'm throwing in the towel. I am attempting to scrape some data from a web page. Here's a snippet with some of the data I'm trying to extract:
<span itemprop="thumbnail" itemscope itemtype="http://schema.org/I +mageObject"> <link itemprop="url" href="http://blahblah.org/video/thumbnail +_23432230.jpg"> <meta itemprop="width" content="1280"> <meta itemprop="height" content="720"> </span>
I want to grab the value of the href property form the <link> tag with the Web::Scraper module. Here's the relevant perl code:
my $div = scraper { process 'span[itemprop="thumbnail"] > link', url => '@href'; }; my $res = $div->scrape( $html ); $url = $res->{url};
No matter what I try, $url returns undefined. I'm using version .36 of the Web::Scraper module. </code>

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
$nysus = $PM . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: Pulling data from child elements using Web::Scraper
by nysus (Parson) on Jan 18, 2015 at 13:03 UTC

    It turns out it was a bug in a module underlying Web::Scraper. I cross posted this question to Stackoverflow.

    What I want to know now is can I be excommunicated from Perl Monks for posting to stack overflow?

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks

      With immediate effect you are excluded from consuming blessed onions while wearing a sacred camel hair scarf for the coming 42**Pi system seconds!

      Cheers Rolf

      PS: Je suis Charlie!

      ps: ;-P

        Only about 35 hours

        With immediate effect you are excluded from consuming blessed onions while wearing a sacred camel hair scarf for the coming 42**Pi system seconds!

        What does that mean LanX?

        Why are you shouting LanX?

Re: Pulling data from child elements using Web::Scraper
by GotToBTru (Prior) on Jan 18, 2015 at 06:30 UTC

    Does $div contain what you think it does? I would start with the most generic level of scraping and verify that I am getting what I expect, and then refine the statements down from there.

    Dum Spiro Spero