1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dump qw(dump);
use WWW::Mechanize;
use Mojo::DOM;
my $mech = WWW::Mechanize->new();
$mech->timeout(30);
$mech->agent_alias('Windows Mozilla');
$mech->get('http://www.url.de/1426-profile.html');
my $dom = Mojo::DOM->new($mech->content);
my $collection4 = $dom->find('.portraitSetCard > img');
print $collection4;
<img alt="User-Foto" src="http://www.url.de/bla/picture.jpg" style="float:left; margin-right:1em;" title="User-Foto">
my $collection4 = $dom->find('.portraitSetCard > img[src]');
<img alt="User-Foto" src="http://www.url.de/bla/picture.jpg" style="float:left; margin-right:1em;" title="User-Foto">
my $collection4 = $dom->find('.portraitSetCard > img')->attr('src');