Leser: 8
1 2 3 4 5 6 7 8
$VAR1 = { 'urls' => [ bless( do{\(my $o = 'https://www.finanzen.net/aktien/3m-aktie')}, 'URI::https' ), bless( do{\(my $o = 'https://www.finanzen.net/aktien/american_express-aktie')}, 'URI::https' ), bless( do{\(my $o = 'https://www.finanzen.net/aktien/walmart-aktie')}, 'URI::https' ), bless( do{\(my $o = 'https://www.finanzen.net/aktien/disney-aktie')}, 'URI::https' ) ] };
1
2
3
4
5
6
7
8
9
10
# website to scrape
my $urlToScrape = "https://www.finanzen.net/index/dow_jones/werte";
# prepare data
my $names = scraper {
# we will save the urls
process ".table.table-small.table-hover > tr > td > a", 'urls[]' => '@href';
};
# scrape the data
my $res = $names->scrape(URI->new($urlToScrape));
print Dumper $res;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use v5.12; use warnings; use Data::Dumper; use Web::Scraper; use URI; # website to scrape my $urlToScrape = "https://www.finanzen.net/index/dow_jones/werte"; # prepare data my $names = scraper { # we will save the urls process ".table.table-small.table-hover > tr > td > a", 'urls[]' => '@href'; }; # scrape the data my $res = $names->scrape(URI->new($urlToScrape)); #print Dumper $res; my @urls; for my $cur_uri (@{ $res->{urls} }) { my $url = $cur_uri->as_string(); say "Add $url to array."; push @urls, $url; }
2021-06-04T05:27:13 styx-ccuse v5.12 statt 5.10