Re: insert comments into elementtree

2007-11-19 Thread Tim Arnold
"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 inst

Re: insert comments into elementtree

2007-11-16 Thread Stefan Behnel
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/ ht

insert comments into elementtree

2007-11-16 Thread Tim Arnold
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. So I'm trying to put them back in, but I'm doing something wrong: here's the code snippet of how I generate the Trees: from elementtree import ElementT