in reply to Re: Problems with TableExtract
in thread Problems with TableExtract

Cool module :)

I looked at my version and I have 1.08, for simplicity I had just gone with the debian version, I guess its a bit behind.

I wonder if he did the same as me, has an older version but was looking at the docs on search.cpan.org :)

                - Ant
                - Some of my best work - (1 2 3)

Replies are listed 'Best First'.
Re^3: Problems with TableExtract
by mojotoad (Monsignor) on Jan 10, 2006 at 06:32 UTC
    With 1.08, try this:
    my $te = HTML::TableExtract->new( headers => [qw($service $arrival $tr +ansit)] ); $te->parse($html_string); my $ts = $te->first_table_state_found; foreach my $row ($ts->rows) { foreach my $cell (@$row) { print $cell; } }

    If it's actually capturing tables, that should work. (you can monitor, in detail, whether tables are being captured by setting the 'debug' parameter to varying levels (1..7) in the new() constructor).

    Let me know what happens,
    Matt

Re^3: Problems with TableExtract
by mojotoad (Monsignor) on Jan 10, 2006 at 06:36 UTC
    And yes, part of this is my fault. As I phased out the array-only functionality (i.e. the tables() method) I eventually aliased that to the table_states() method and it has caused confusion. I should have waited longer before ressurecting the tables() method, if at all. (in my defense, it is what I would have called the table_states() method to begin with, but in a very very early version of the module I used tables() to return the arrays. Ah well.)

    Cheers,
    Matt