"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim Arnold wrote: >> Hi, I'm using the TidyHTMLTreeBuilder to generate some elementtrees from >> html. One by-product is that I'm losing comments embedded in the html. > > That's how the parser in ET works. Use lxml instead, which keeps documents > intact while parsing. > > http://codespeak.net/lxml/dev/ > http://codespeak.net/lxml/dev/lxmlhtml.html > > Stefan
Thanks Stefan, I certainly would use lxml if I could get everything to compile on this HPux10.20. I did manage to get this one solved by inserting the comments back in like this: elem.insert(0,ET.Comment('stopindex')) thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list