I\'m trying to parse, manipulate, and output HTML using Python\'s ElementTree:
import sys
from cStringIO import StringIO
from xml.etree import ElementTree as E
HTML is not the same as XML, so tags like
will not work. Ideally, if you are trying to pass that information via XML, you could first xml-encode the above data, so it would look something like this:
<htm>
<body>
<p>Less than <</p>
<p>Non-breaking space </p>
</body>
</html>
And then after parsing the XML you can HTML-unencode the string.