larsen has asked for the wisdom of the Perl Monks concerning the following question:
I suppose you were faced at least once with the problem of
reverse engineering extremely poor written HTML.
In this case the issue is not simply parsing
HTML, but guessing the structure (is there's a structure)
behind what has been written by some absent minded HTML-coder
(artificial, human or a messy combination of both).
Here an example of what I'm coping with:
...and so on.</tr> </table><html> <body bgcolor="#FFFFFF"> <table border="0" cellspacing="0" cellpadding="0"> <link rel="style +sheet" href="/stile.css" type="text/css"> <tr> <td> <span class="span"> <font color="#FF0000" size="1" face="Verdana, Arial">29/05/200 +1 15:30</font> <font size="1" face="Verdana, Arial">(ACOI - associazione Chirurghi os +pedalieri italiani) <br> <a href="http://www.immedia.it/published/20010529/200105291468 +3.shtml" target="ImmediaPress"><font size="1" face="Verdana, Arial"> <b>IN DUEMILA DA TUTTO IL MONDO AL CONGRESSO DELL'ASSOCIAZIONE DEI CHIRURGHI OSPEDALIERI ITALIANI </b></font> </a> <br> <!-- <font face="verdana, arial, helvetica" size="1"> (IMMEDIAPRESS) Modena e' stata per quattro giorni una citta' i +nternazionale grazie... </font> --> </font> </td> </tr> <tr> <td> <img src="http://www.immedia.it/images/line_home.gif" width=30 +8 height=1 border=0 alt=""><br> </td> </tr> <tr><td height="6"></td></tr> </table> </body> </html><html> <body bgcolor="#FFFFFF">
Now I'm using Adobe GoLive to dig through HTML code, since it provides a tree view that is the best I'm aware of. I ask you if there are common tecniques or general principles to deal with such problems. Thank you.
2001-06-16 Edit by Corion : Fixed link
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Reverse engineering HTML
by Corion (Patriarch) on Jun 14, 2001 at 17:52 UTC | |
by THRAK (Monk) on Jun 14, 2001 at 21:06 UTC | |
Re: Reverse engineering HTML
by Masem (Monsignor) on Jun 14, 2001 at 17:34 UTC | |
Re: Reverse engineering HTML
by Vynce (Friar) on Jun 14, 2001 at 17:40 UTC | |
Re: Reverse engineering HTML
by schumi (Hermit) on Jun 14, 2001 at 19:19 UTC | |
by BrotherAde (Pilgrim) on Jun 20, 2001 at 10:39 UTC | |
by schumi (Hermit) on Jun 20, 2001 at 11:29 UTC | |
Re: Reverse engineering HTML
by one4k4 (Hermit) on Jun 14, 2001 at 20:01 UTC |
Back to
Seekers of Perl Wisdom