Here you go

#!/usr/bin/perl -- use strict; use warnings; use HTML::TableExtract ; Main( @ARGV ); exit( 0 ); sub Main { my $te = HTML::TableExtract->new( br_translate => 0 ); $te->parse( SkewHtml() ); $te->eof; my $tab = $te->first_table_found; for my $rxrow ( $tab->row_indices ){ for my $rxcol ( $tab->col_indices){ my $cell = $tab->space( $rxrow, $rxcol ); print "row($rxrow)col($rxcol) = $cell\n"; } } } ## end of Main sub SkewHtml { return q{ <html><head><title>skew test</title></head> <body> <table border=1> <tr> <td>head0</td> <td>head1</td> <td>head2</td> <td>head3</td> </tr> <tr> <td colspan=4>THIS IS A WHOLE ROW-CELL OF JUNK</td> </tr> <tr> <td rowspan=2>JUNK</td> <td>Tasty tidbit (1,1)</td> <td>JUNK</td> <td>Tasty tidbit (1,3)</td> </tr> <tr> <td colspan=2 rowspan=3>BIG JUNK</td> <td>Tasty tidbit (2,3)</td> </tr> <tr> <td>Tasty tidbit (3,0)</td> <td>Tasty tidbit (3,3)</td> </tr> <tr> <td>Tasty tidbit (4,0)</td> <td>Tasty tidbit (4,3)</td> </tr> <tr> <td colspan=2>JUNK BUTTON</td> <td>Tasty tidbit (5,2)</td> <td>Tasty tidbit (5,3)</td> </tr> </table> </body> </html> }; } ## end of SkewHtml __END__ row(0)col(0) = head0 row(0)col(1) = head1 row(0)col(2) = head2 row(0)col(3) = head3 row(1)col(0) = THIS IS A WHOLE ROW-CELL OF JUNK row(1)col(1) = THIS IS A WHOLE ROW-CELL OF JUNK row(1)col(2) = THIS IS A WHOLE ROW-CELL OF JUNK row(1)col(3) = THIS IS A WHOLE ROW-CELL OF JUNK row(2)col(0) = JUNK row(2)col(1) = Tasty tidbit (1,1) row(2)col(2) = JUNK row(2)col(3) = Tasty tidbit (1,3) row(3)col(0) = JUNK row(3)col(1) = BIG JUNK row(3)col(2) = BIG JUNK row(3)col(3) = Tasty tidbit (2,3) row(4)col(0) = Tasty tidbit (3,0) row(4)col(1) = BIG JUNK row(4)col(2) = BIG JUNK row(4)col(3) = Tasty tidbit (3,3) row(5)col(0) = Tasty tidbit (4,0) row(5)col(1) = BIG JUNK row(5)col(2) = BIG JUNK row(5)col(3) = Tasty tidbit (4,3) row(6)col(0) = JUNK BUTTON row(6)col(1) = JUNK BUTTON row(6)col(2) = Tasty tidbit (5,2) row(6)col(3) = Tasty tidbit (5,3)

In reply to Re^4: Fetching table from website using HTML::TableExtract by Anonymous Monk
in thread Fetching table from website using HTML::TableExtract by sachin raj aryan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.