use WWW::Mechanize;
use HTTP::Cookies;
use HTML::TableParser;
use HTML::TableExtract;
my $mech = WWW::Mechanize->new();
$mech->get('http://www.w3schools.com/sql/default.asp');
my $a = $mech->content();
$te = HTML::TableExtract->new( headers => [('Company', 'Country')] );
$te->parse($html_string);
# Examine all matching tables
foreach $ts ($te->tables) {
print "Table (", join(',', $ts->coords), "):\n";
foreach $row ($ts->rows) {
print join(',', @$row), "\n";
}
}
# Shorthand...top level rows() method assumes the first table found in
# the document if no arguments are supplied.
foreach $row ($te->rows) {
print join(',', @$row), "\n";
}