#!/usr/bin/perl use strict; use warnings; use CGI; use HTML::TableExtract; use LWP::UserAgent; my $cgi = CGI->new; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => "https://int.soccerway.com/matches/2020/12/28/"); my $res = $ua->request($req); my $html = $res->decoded_content; $html =~ s///gs; $html =~ s///gs; $html =~ s/]*class="events-button button first-occur")[^>]*>//gs; my $table = HTML::TableExtract->new(); $table->parse($html); my $input = $cgi->param("team"); my $response =''; print "Content-type: text/html\n\n"; foreach my $row ($table->rows) { my $output = join("", @$row); $output =~ s/\R//g; print $output; if ($input) { # Find matching team (Its a must to find team after word FT) if ($output =~ m/$input/) { # After that team the next is score (Gets team scores - left side) # Or after scores what team is near (Gets team scores - Right side) my $score = $output =~ /$input\s*?(\S+)/; $response ="Found Team And Score is: $score"; } else { $response ="Can't find team"; } } } print <

Test



$response

EOF