in reply to Re^8: HTML::TableExtract (parse table column from an HTML page)
in thread HTML::TableExtract (parse table column from an HTML page)

OK let's take WWW::Mechanize out of the equation, for the moment. Does this stand-alone snippet work for you?

use strict; use warnings; use HTML::TableExtract qw/ tree /; my $html = <<EOT; <html> <head> <title>test page</title> <head> <body> <table> <tr><td>parse me</td></tr> </table> </body> </html> EOT my $te = HTML::TableExtract->new; $te->parse($html); my $table = $te->first_table_found; my $tree = $table->tree; print $tree->cell(0,0)->as_text;

BTW, your test HTML is malformed (there's no closing <head> tag), but that doesn't affect the output of the script, at least on my machine...

Replies are listed 'Best First'.
Re^10: HTML::TableExtract (parse table column from an HTML page)
by cafaro (Novice) on Oct 08, 2007 at 15:25 UTC
    Still getting the same error with that script..

      Then you have a problem that I have no idea how to solve. Sorry.

      Maybe you could try to de-/re-install HTML::TableExtract?

      Or to update the version of perl that you are using?

        Have you tried to run the script yourself and did it work? I have the latest version of Perl