Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
brainpan emerges from the shadows of the monastery and humbly seeks enlightenment from his elders.

I'm wanting to parse the content out of an html table using HTML::TableExtract. For most of the data this only takes a few lines, but for some reason I can't make it search for a header when that header consists only of an image (for which I know the URL). I assume that the source of the problem lies in the fact that, as TableExtract is a subclass of HTML::Parser, it's no longer seeing the url for the image as text that it should be parsing. If I were dealing with HTML::TokeParser I'd work around this with a line like this:

$tokeparser->{textify} = {img => 'src'};

However, I can't figure out how to do this with HTML::Parser. Am I approaching this the right way? Do I need to 'textify' HTML::Parser objects to make HTML::TableExtract search for the image's url, or can all this be done interfacing only with TableExtract? Is there some better way to extract the data from an HTML table when using an image as an anchor point?

And no, I don't own 27 pairs of sweatpants.

In reply to using the headers method of HTML::TableExtract to find an image by brainpan

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (9)
    As of 2019-06-26 18:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Is there a future for codeless software?



      Results (111 votes). Check out past polls.

      Notices?