[lxml-dev] lxml.html.ElementSoup

Stefan Behnel stefan_ml at behnel.de
Sun Mar 16 09:34:40 CET 2008


Hi,

Ian Bicking wrote:
> I believe lxml.html.ElementSoup.parse doesn't have the same API as other 
> parse functions -- it returns an element, where the other parse 
> functions return trees.
> 
> Also, should ElementSoup have a lower case name?  (Maybe renaming it 
> would make deprecating this parse behavior easier too)

I think we can fix both problems. What about adding a module
"lxml.html.soupparser" that has the expected interface, and make
ElementSoup.py a pure legacy wrapper around that? We could then also add a
fromstring() method that would accept plain strings, so that users wouldn't
have to do the StringIO() dance themselves.

Stefan


More information about the lxml-dev mailing list