Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 4ad3d1a5da4da0b6f17e448e62d8ca92 > files > 15

perl-Web-Scraper-0.370.0-3.mga4.noarch.rpm

#!/usr/bin/perl
use strict;
use warnings;
use URI;
use lib "lib";
use Web::Scraper;

my $uri = shift @ARGV or die "URI needed";

my $scraper = scraper {
    process "a[href]", "urls[]" => '@href';
    result 'urls';
};

my $links = $scraper->scrape(URI->new($uri));
use YAML;
warn Dump $links;