in reply to Re^2: resolving HTML::TableExtract error
in thread resolving HTML::TableExtract error
The HTML snippet you provided above is not conducive to testing your code. Besides not being enclosed in <table> tags, it only has one row (the header). Both (apparently) prevent the HTML from being parsed into a table_state.
Once I fixed that, your code (with haoess's extra loop over the tablestates) started producing data. One note of caution: According to the documentation, you should be passing regular expression strings to the constructor, not actual regular expressions. I.e., your constructor should look like:
... although your constructor with the qr//'s was working as well.my $te = HTML::TableExtract->new( headers => [ qw( Month\s* First\s* High\s* ... )] );
I had no trouble using the rows method on the table extract object directly, as in your original post. That makes me wonder whether you grabbed an older version off CPAN. I'm guessing the shorthand rows method in the HTML::TableExtract class might have been added somewhere down the line. The version I have is 1.10.
Hope this helps...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: resolving HTML::TableExtract error
by jaydon (Novice) on Jul 14, 2005 at 15:43 UTC |