in reply to Extracted HTML table
use WWW::Mechanize; use HTML::TableExtract; $url = "http://www.sailwx.info/shiptrack/cruiseships.phtml"; my $input; my $m = WWW::Mechanize->new(); $m->get($url); $input = $m->content; my $te; # $te = HTML::TableExtract->new( attribs => { border => 1 } ); # works # $te = HTML::TableExtract->new(headers => ['Ship', 'position']); # wo +rks # $te = HTML::TableExtract->new(headers => [qw(Ship position)]); # wor +ks $te = new HTML::TableExtract ( headers => [qw(Ship position)] ); # wor +ks $te->parse($input); foreach my $row ($te->rows) { print Dumper($row); use Data::Dumper; }
|
|---|