Re: urgent need help in parsing html tables
This is the program I wrote:
#!/usr/bin/perl
use HTML::TableExtract;
open (HTML, '/root/Desktop/test.html') or die "$!";
my $html = do {local $/; <HTML>};#puts the entire file in a scalar variable
$te = HTML::TableExtract->new( headers => [qw(Heading Heading_2)] );
$te->parse($HTML);
# Examine all matching tables
foreach $ts ($te->tables) {
print "Table (", join(',', $ts->coords), "):\n";
foreach $row ($ts->rows) {
print join(',', @$row), "\n";
}
}
But when I do perl program.pl it does not do anything, it gives me a prompt.
Thanks for the reply I would appreciate if you solve this problem.
I am literally not getthing anything and after I do perl program.pl I get another prompt.
Thanks , please help