Beautiful Soup - Parsing HTML / XML Quickly and easily: Python Advent 2021 Library

Опубликовано: 28 Июль 2026
на канале: InvalidEntry
2,277
27

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.