Re: elementtidy, \0 chars and parsing from a string

2006-05-09 Thread Simon Percivall
Well, it seems you can do: parser = elementtidy.TidyHTMLTreeBuilder.TidyHTMLTreeBuilder() parser.feed(your_str) tree = elementtree.ElementTree.ElementTree(element=parser.close()) Look at the parse() method in the ElementTree class. -- http://mail.python.org/mailman/listinfo/python-list

elementtidy, \0 chars and parsing from a string

2006-05-09 Thread Steven Bethard
So I see that elementtidy doesn't like strings with \0 characters in them: >>> import urllib >>> from elementtidy import TidyHTMLTreeBuilder >>> url = 'http://news.bbc.co.uk/1/hi/world/europe/492215.stm' >>> url_file = urllib.urlopen(url) >>> tree = TidyHTMLTreeBuilder.parse(url_file) Traceba