I'm not sure I understand your statement of circumstances. First, what do you mean by "dynamic" columns? "Columns whose quantity and or headers may vary from one time to another" is what occurs to me, except that that makes little sense, so probably I'm not clear about your intent.

And you go on to say, "So is it possible to retrieve entire table by using only static columns names. " which I take to be a question, despite the lack of a question mark. If so, the answer is "No, not with Table::Extract. For that review other modules such as HTML::Parser or members of the WWW::... group (esp. WWW::Mechanize)."

The docs for HTML::Extract say quite specifically

... tables can be matched using column headers, depth, count within a depth, table tag attributes, or some combination of the four.

and, again, in the DESCRIPTION section,

There are currently four constraints available to specify which tables you would like to extract from a document: *Headers*, *Depth*, *Count*, and *Attributes*.

Skipping back toward the top of the doc, does the second example relate to your question?

The third example, using tags to ID by attributes, seems unlikely to fit your problem description, and once again, it relies on the programmer knowing the header names desired... and on the web-monkeys having used a header row of <th>...</th> labels... something I wouldn't want to guarantee (as a P/T web-monkey, myself), as some are [lazy ignorant limited-to-inadequate-tools] and because some tables content is too obvious in intent to justify the added header code.

And, if none of this addresses your concerns, please set me straight by clarifying the question.


In reply to Re: Retrieving tables using Html:TableExtract by ww
in thread Retrieving tables using Html:TableExtract by mecrazycoder

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.