I used html::tablecontentparser to extract tables from http://www.municipalcourt.org:81/connection/court/lookup.xsp?in=ct&case=04TRD02044-A&view=detail and write all information to an excel file. But, the code and the result as following: please help me

use LWP::Simple; use URI; use HTML::TableContentParser; use HTML::Entities; our $page; our $tables; our $tcp = new HTML::TableContentParser; our $modules; our $query; our $count=0; our $query = "http://www.municipalcourt.org:81/connection/court/lookup +.xsp?in=ct&case=04TRD02044-A&view=detail"; $page = get($query); $p = HTML::TableContentParser->new(); $tables = $p->parse($page); for $t (@$tables) { for $r (@{$t->{rows}}) { print "Row: "; for $c (@{$r->{cells}}) { print "[$c->{data}] "; } print "\n"; } }
results:
Row: Row: [ ] Row: Row: [<a href="http://www.municipalcourt.org" class="style1">Home</a>] Row: Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=summary"> +-Summary</ a>] Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=status">- +Status</a> ] Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=docket">- +Docket</a> ] Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=balance"> +-Balance</ a>] Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=payments" +>-Payments </a>] Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=priors">- +Priors</a> ] Row: [<a href="lookup.xsp?in=ct&amp;case=04TRD02044&amp;view=aka">-AKA +</a>] Row: Row: [<a href="lookup.xsp?in=cv">Civil&#32893;Lookup</a>] Row: [<a href="lookup.xsp?in=ct">TR/CR&#32893;Lookup</a>] Row: Row: [<a href="query.xsp?in=cv&amp;option=index">Civil&#32893;Query</a +>] Row: [<a href="query.xsp?in=ct&amp;option=index">TR/CR&#32893;Query</a +>] Row: [] [ <h2>Detail for TR/CR Case <em>04TRD02044-A</em> </h2> ] Row: [] Row: [ ] Row: Row: Row: .....................................

In reply to need help to extract table form html by yusy

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.