DEV Community

Discussion on: Do you use BeautifulSoup or LXML to parse your HTML markup in Python?

Collapse
 
jmcp profile image
James McPherson

I'm biased in favour of BeautifulSoup, because the majority of the html and xml I've come across is not well-formed. In my experience BeautifulSoup is much more forgiving.

I've made use of it in

github.com/jmcp/grabbag/blob/maste...
and
github.com/jmcp/grabbag/blob/maste...

and in another minor project I'm working over at the moment where I'm taking KML and ogr2ogr-converted Mapinfo shape files which will find its way to the grabbag in due course.

Collapse
 
jmcp profile image
James McPherson

I'm not particularly stressed about the performance of the solution, btw, so long as I have written efficient code I'm not worried about the library I'm using.