in reply to HTML::Parser guidance
Well the first thing you need to do when it comes to parsing data records from HTML documents, is to look at the markup structure of the document and determine the simplest "search rule" that matches all data records (without matching any false positives).
If I understand your post correctly, each record in your case will be of the form <div class="message1">...</div>. But that's not enough information to determine the "search rule" for matching all of them, you need to look at what exactly changes from record to record, and at the page structure they're embedded in.
Here are some examples of what the "search rule" could be, depending on the exact document structure at hand (sorted from simpler to more complex):
PS: As for formatting questions on PerlMonks, it's best to put code (including HTML markup) in <code>...</code> tags - among other benefits you can then keep the angled brackets in the code, they will show up verbatim.
|
|---|