hi aquarium,

I suggested starting a new thread. The previous thread, collect data from web pages and insert into mysql had made some progress and I thought the next step warranted a new thread (we had got down to Re^11). Tackle a broad question in chuncks rather than in one go. I still think it was reasonable advice but perhaps a bit more explanation and some working code would have helped. :-)

As SteinerKD has indicated $t is an HTML::TreeBuilder object and should have been passed to the sub. H::TB returns HTML::Element objects and it is there that $t->look_down() and $t->as_text are documented.

It's not clever code but may well be hard to figure out and not great to work with. With hindsight it might be more appropriate to use something like HTML::TableExtract. In the previous thread we already had a H::TB object and that was pressed into service.


In reply to Re^2: using HTML::TreeBuilder to collect data for populating variables by wfsp
in thread using HTML::TreeBuilder to collect data for populating variables by SteinerKD

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.