in reply to Extracted HTML table
outputs (extract)#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; use HTML::TableExtract; use WWW::Mechanize; $Data::Dumper::Indent = 1; my $url = "http://www.sailwx.info/shiptrack/cruiseships.phtml"; my $m = WWW::Mechanize->new(); $m->get($url); die unless $m->success; my $input = $m->content; my $te = HTML::TableExtract->new( headers => [qw(Ship position)] ) or die qq{$!}; $te->parse($input); foreach my $row ($te->rows) { print Dumper($row); }
$VAR1 = [ 'Carnival Freedom', "N 18\x{b0}30', W 077\x{b0}06'" ]; $VAR1 = [ 'Carnival Glory', "N 19\x{b0}24', W 064\x{b0}48'" ]; $VAR1 = [ 'Azamara Journey', "S 35\x{b0}06', W 056\x{b0}48'" ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extracted HTML table
by mcoblentz (Scribe) on Mar 20, 2008 at 14:24 UTC |