Beautiful Soup
crummy.com
Beautiful Soup
1–10 of 95 posts
Re: Beautiful Soup
#2Re: Beautiful Soup
#3Just in case someone wants a comment overview of what this superbly named library is: web scraping (html parsing) in python
Re: Beautiful Soup
#4We used this in a project many suns ago and we ended up switching to libxml2, less pretty presentation, but more functional. YMMV.
Re: Beautiful Soup
#5I find this to be a better version of the docs: https://beautiful-soup-4.readthedocs.io/en/latest/# Just in case someone wants a comment overview of what this superbly named library is: web scraping (html parsing) in python
Re: Beautiful Soup
#6Re: Beautiful Soup
#7Re: Beautiful Soup
#8It is fast? no.
But it had a fantastic mission: extracting data from malformed HTML.
Might be less common now but back then (~10+ years ago) it was still rampant. Many if not most parsers would barf on any deviation from the standard, leaving you to hand-roll regex solutions and ugly corner cases.
BS covered a LOT of these cases without forcing you to write terrible code. It mostly just worked, with a reasonable API, and stellar, well-written, example-laden docs.
Re: Beautiful Soup
#9We used this in a project many suns ago and we ended up switching to libxml2, less pretty presentation, but more functional. YMMV.
bs4 introduced some very nice features over bs3, if that's what you were using, and includes the ability to use libxml2 as a parser. For very simple things though libxml2 would be a better fit.
For these cases it can be useful to do the reverse, and use the BeautifulSoup HTML parser as an alternative parser backend for the lxml package: https://lxml.de/elementsoup.html