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:
</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">
...and so on.
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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|