Comparison
bs4 vs lxml
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Dummy package for Beautiful Soup (beautifulsoup4)
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
$
pip install bs4Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
Actively maintained. Last release 3 days ago, commits in 18 of the last 26 weeks. A safe choice.
$
pip install lxmlIn short
- bs4 is slowing down (last release over 2 years ago): fine for existing code, risky for a new project.
- lxml is the most used: 445.4M downloads a month, 25× more than bs4.
- lxml also has the best Pythie’s Index (84).
- lxml is growing fastest: downloads +13% over the last month.
- Safe default for a new project: lxml.