As part of Advent 2021, I’m doing a review of some fun and useful python libraries – 24 libraries in 24 days, and today we’re looking at Beautiful Soup, which, in my opinion, is the best python HTML or XML parser. It claims to save programmers hours or days, but I think it saved my sanity.
It’s probably a little less well known, but it’s able to handle not just formally defined correct XML based languages, but also those with glaring errors – things like mismatched tags. It’s essential to anyone building web bots to HTML Parse (or in the more commonly used phrase: Screen Scrape) websites, and when tied in with Requests (the library from yesterday), it allows us to write primitive web bots in only a few lines of code.
I use this library in a ton of places, because it's so powerful and helpful – if I ever must write XML API’s, I use this to deal with the occasionally very random things that the customers can send at us.
![](https://s2.save4k.ru/pic/fG1K6hklQak/maxresdefault.jpg)