I'm trying to parse an HTML Table with HTML::ElementTable with this
code:
my $schedaHtml = $ua->get($schedaLinkUrl->as_string);
my $te = new HTML::TableExtract( headers => [qw(Codice Taglie
DisponibilitÃ)] );
chomp(my $htmlstring = $schedaHtml->content);
$te->parse($htmlstring);
foreach my $ts ($te->table_states) {
foreach my $values ($ts->rows) {
my @a = @{$values};
print trim($a[0]) . ' ' . trim($a[1]) . ' ' . trim($a[2]) . "\n\n";
}
}
But when i run it I get this message
HTML::ElementTable::DataElement=HASH(0x15bb00c) for each table (I
suppose).
$htmlstring should be an html string, right? If I print with the
content method I get the entire html page, but if I pass this string
to HTML::ElementTable parse method ($te->parse($htmlstring);) I get
HTML::ElementTable::DataElement=HASH(0x15bb00c).
What's wrong with my code?
Many thanks.
Regards.
Gius.