Ok, so english not being my main language has a lot to do with the fact that I first mistook parse to paste, but that's another story...

I totally understand now what is the meaning of parse, but when I tried to put it at work, it cracked.

I was trying to match some tags from inside an HTML document, so I thought, Ok, what's better than HTML::...s, looked at HTML::Parser, and here is something from the perldoc:

The `HTML::Parser' will tokenize an HTML document when the parse() method is called by invoking various callback methods. The document to be parsed can be supplied in arbitrary chunks.

So? what do I do next? I know that it has now parsed it and understood it.. but what do I get?

Let's say I want to fetch a remote html file using LWP::Simple then search the file for the occurence of a certain criteria <h3>foo</h3> and then get everything after that that is in between <EM> tags until I reach an <HR>. I don't think it's hard to do, but I'm not familiar with the way I need to do this, cause I'm not understanding what to do with the parser.

anyone ready to give me a bit of explanation on that?

--Chady


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

In reply to Parse... then what? (HTML Parsing problems) by Chady

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.