in reply to perl html table extract to get data from two tables.
sub get_table { my $headers = shift; $table_extract = HTML::TableExtract->new(headers => $headers); $table_output = Text::Table->new(); $table_extract->parse_file($html); ($table) = $table_extract->tables; foreach my $row ($table->rows) { $table_output->load($row); print " ", join(',',grep defined, @$row),"\n"; print $ofh " ", join(',',grep defined, @$row), "\n"; } } # calling the sub for each table get_table( [ 'Status', 'Results', 'Schedule Name' ] ); get_table( [ 'Status', 'Results', 'Node Name' ] );
|
|---|