Abram <> wrote:
> I can use TableExtract to get the exact tables using the depth and
> count matching (depth is always 2 and count is 5-7), but I am not sure
> how to then parse only that table and extract the data. I'm sure this
> is pretty simple stuff, and I'll kick myself when I see the answer.
From "perldoc HTML::TableExtract":
$te = new HTML::TableExtract( depth => 2, count => 2 );
$te->parse($html_string);
foreach $ts ($te->table_states) {
print "Table found at ", join(',', $ts->coords), ":\n";
foreach $row ($ts->rows) {
print " ", join(',', @$row), "\n";
}
}
That seems to do it.
Are you having trouble modifying that to produce CSV?
--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas