12.05. 17:00
Brighton
Manchester City
1
4
####
#!/usr/bin/perl
use Mojo::UserAgent;
use Mojo::DOM;
my $ua = Mojo::UserAgent->new;
my $res = $ua->get('https://www.flashscore.com/football/england/premier-league-2018-2019/results/')->result;
if ($res->is_success) {
my $dom = Mojo::DOM->new($res->body);
my @matches = $dom->find('div.event__match event__match--withRowLink event__match--static event__match--twoLine')->each;
# Iterate through the event__match event__match--withRowLink event__match--static event__match--twoLine and extract text
foreach my $results (@matches) {
my $Time = $results->find('div.event_ _time')->map('text')->join;
my $teamA = $results->find('div.wcl-participant_7lPCX event__homeParticipant')->map('text')->join;
my $teamB = $results->find('div.wcl-participant_7lPCX event__awayParticipant')->map('text')->join;
my $teamA_Scores = $results->find('span.wcl-matchRowScore_jcvjd wcl-isFinal_Am7cC event__score event__score--home')->map('text')->join;
my $teamB_Scores = $results->find('span.wcl-matchRowScore_jcvjd wcl-isFinal_Am7cC event__score event__score--away')->map('text')->join;
print "$teamA : $teamA_Scores: $Time";
print "$teamB : $teamB_Scores: $Time";
}
} else {
print "Cannot parse the result. " . $res->message . "n";
}