my $te = HTML::TableExtract->new( headers => [qw($service $arrival $transit)] ); $te->parse($html_string); my $ts = $te->first_table_state_found; foreach my $row ($ts->rows) { foreach my $cell (@$row) { print $cell; } }