4 ms·
The only problem with BeautifulSoup is that its kind of slow, but if it's fast enough for you go for it, otherwise you can try lxml with its lxml.html module. S
by rhymes 17y ago
The only problem with BeautifulSoup is that its kind of slow, but if it's fast enough for you go for it, otherwise you can try lxml with its lxml.html module. See also: http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ http://blog.ianbicking.org/2008/03/30/python-html-parser-per...
- jamongkad 17y agoUpvote I used to dig BeautifulSoup. It's latest release is slower than it's predecessors. That's why I use PyQuery nowadays, it's based on lxml and uses a jQuery like API to access the DOM.
- joshu 17y agoI'm always terrified that these conversations will unearth a library or technique that will immediately obsolete most of the code in my current pet project. Thanks!
- kingkilr 17y agoI highly reccomend PyQuery. It's basically the jQuery API on top of lxml.
- euroclydon 17y agoany chance of this running in IronPython?
- icey 17y agoDon't quote me on this, but I believe you can get this running by way of IronClad. (AFAIK lxml doesn't run on IronPython without using IronClad right now.) http://www.resolversystems.com/products/ironclad/ http://www.resolversystems.com/products/ironclad/
- natrius 17y agoI forgot what BeautifulSoup couldn't do that made me look for something else, but I've been using html5lib for those purposes these days with good results, especially if you need to output modified HTML.