#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; use HTML::TableContentParser; my $url = q|http://64.144.108.98/history/Allplayersstate.asp?State=AL|; my $mech = WWW::Mechanize->new() or die "couldn't get Mech object: $!"; $mech->get($url) or die "couldn't get: $!"; my $html = $mech->content() or die "content failed: $!"; my $p = HTML::TableContentParser->new(); my $tables = $p->parse($html); open my $fh, '>', 'tables.txt' or die "can't open output\n"; for my $t (@$tables) { for my $r (@{$t->{rows}}) { print $fh "Row: "; for my $c (@{$r->{cells}}) { my $data = $c->{data}; print $fh "[$data] "; } print $fh "\n"; } }