Subject: | error in table extract sample code |
Date: | Mon, 7 Apr 2008 04:18:38 +0800 |
To: | bug-HTML-TableExtract [...] rt.cpan.org |
From: | davidt <ion [...] comsil.com> |
I think i found a bug in the example of HTML Extract...
http://search.cpan.org/~msisk/HTML-TableExtract-2.10/lib/HTML/TableExtract.pm#SYNOPSIS
Should it just be " $te->parse($html_file);"
# Example: Using depth and count information.
# Every table in the document has a unique depth and count tuple, so
# when both are specified it is a unique table. Depth and count both
# begin with 0, so in this case we are looking for a table (depth 2)
# within a table (depth 1) within a table (depth 0, which is the top
# level HTML document). In addition, it must be the third (count 2)
# such instance of a table at that depth.
$te = HTML::TableExtract->new( depth => 2, count => 2 );
$te->parse_file($html_file);
foreach $ts ($te->tables) {
print "Table found at ", join(',', $ts->coords), ":\n";
foreach $row ($ts->rows) {
print " ", join(',', @$row), "\n";
}
}