kalyanrajsista has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I'm trying to extract HTML table rows with the following code
use strict; use warnings; use HTML::TableExtract; use Data::Dumper; my $html = qq{ <HTML> <BODY> <table border="1"> <tr><td align="center" nowrap><font size="2"><u>Activity #</u><t +d align="center"><font size="2">Some ID<br>/Debit ID</font> +</td></tr> <tr><td align="right"><font size="2">588476377</font></td><td><f +ont size="2"><a href="/cgi-bin/page?id=1275591">1275591</a></font></t +d></tr> <tr><td align="right"><font size="2">588484813</font></td><td><f +ont size="2"><a href="/cgi-bin/page?id=1210540">1210540</a></font></t +d></tr> </table> </BODY> </HTML> }; my $te = HTML::TableExtract->new( headers => ['Some ID'] ); $te->parse($html); eval { $te->rows; }; if ( $@ ) { print "No rows found\n"; } print Dumper($te->rows);
When trying to extract with table headers like 'Invoice ID' which doesn't display '\ ' in the webpage, code is displaying as 'No rows found'. How can I handle to extract the data even when there are any spaces, '/' or any other characters inside the headers.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Extract HTML rows with headers specified
by wfsp (Abbot) on Jan 29, 2010 at 08:49 UTC | |
Re: Extract HTML rows with headers specified
by steve (Deacon) on Jan 29, 2010 at 19:27 UTC | |
Re: Extract HTML rows with headers specified
by Anonymous Monk on Jan 29, 2010 at 08:58 UTC |
Back to
Seekers of Perl Wisdom