hoopsbwc34 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use HTML::TableExtract; use LWP::UserAgent; my $url = 'http://some.foo.com'; my $ua = LWP::UserAgent->new; my $te = new HTML::TableExtract( headers=> ['Header 2','Header 4'], +depth => 0, count => 3); my $res = $ua->request(HTTP::Request->new(GET => $url), sub {$te->parse($_[0])}); use Data::Dumper; $Data::Dumper::Useqq = 1; foreach my $ts ($te->table_states) { print "Table (", join(',', $ts->coords), "):\n"; foreach my $row ($ts->rows) { foreach (@$row) { tr{\t\r\n\xAO}{ }s; s{^\s+}{}; s{\s+$}{}; } # print Dumper $row; print join(',', @$row), "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Embedded Table Headers with HTML::TableExtract
by bobn (Chaplain) on Jul 12, 2003 at 23:13 UTC | |
by Anonymous Monk on Jul 13, 2003 at 03:55 UTC | |
|
Re: Embedded Table Headers with HTML::TableExtract
by hoopsbwc34 (Initiate) on Jul 15, 2003 at 17:30 UTC | |
|
Re: Embedded Table Headers with HTML::TableExtract
by mojotoad (Monsignor) on Jul 15, 2003 at 19:31 UTC |