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

My code didn't died while parsing the content.
  • Comment on Re^8: HTML::TableExtract (parse table column from an HTML page)

Replies are listed 'Best First'.
Re^9: HTML::TableExtract (parse table column from an HTML page)
by Not_a_Number (Prior) on Oct 07, 2007 at 20:42 UTC

    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...

      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?