pearl_query has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I wanted to access the contents of sub rows within a row in HTML via perl.The table looks somewhat like this.
Project Status
1.abc 1.OK
2.OK
3.OK
2.def 1.Ok
2.failed
I wanted to access the 2nd and 3rd status for the project 1 i.e.abc.It's in a table format.
use HTML::TableExtract; use LWP::Simple; my $proj="abc"; my $cnt; my $Table_Extract = HTML::TableExtract->new(); my $Build_Page = "path of html file"; my $Content = get("$Build_Page"); $Table_Extract->parse($Content); foreach my $ts ($Table_Extract->tables) { foreach my $row ($ts->rows) { if($$row[0]=~/$proj/) { print $$row[1]; } } }
As a result i find the 1st ok only from the table but i want to fetch other results also.
Can you please help me out and suggest some ways to do this.
Sorry for this approach of displaying table as i could'nt upload any screenshot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML:Table extract using perl
by ww (Archbishop) on Dec 05, 2013 at 12:01 UTC |