--- id: beautifulsoup4 version: "4.15.0" license: MIT License license_treatment: permissive maintenance: active --- # beautifulsoup4 — Screen-scraping library License: permissive · Maintenance: active · Popularity: top 100 on PyPI ## Install pip install beautifulsoup4 uv add beautifulsoup4 poetry add beautifulsoup4 ## Description Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree. # Quick start ``` >>> from bs4 import BeautifulSoup >>> soup = BeautifulSoup("

SomebadHTML") >>> print(soup.prettify())

Some bad HTML

>>> soup.find(string="bad") 'bad' >>> soup.i HTML # >>> soup = BeautifulSoup("SomebadXML", "xml") # >>> print(soup.prettify()) Some bad XML ``` To go beyond the basics, [comprehensive documentation is available](https://www.crummy.com/software/BeautifulSoup/bs4/doc/). # Links * [Homepage](https://www.crummy.com/software/BeautifulSoup/bs4/) * [Documentation](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) * [Discussion group](https://groups.google.com/group/beautifulsoup/) * [Development](https://code.launchpad.net/beautifulsoup/) * [Bug tracker](https://bugs.launchpad.net/beautifulsoup/) * [Complete... ## AI interpretation — verify before relying Beautiful Soup parses HTML and XML documents into a tree structure, providing Pythonic methods to search, iterate, and modify the parse tree for web scraping and markup extraction. Verdict: Beautiful Soup is a mature, widely-used screen-scraping library in the top 100 PyPI packages with no known vulnerabilities, permissive MIT licensing, and low install friction. It is production-ready for HTML and XML parsing tasks. [View on SkillFed](https://skillfed.io/packages/beautifulsoup4) · [View on PyPI](https://pypi.org/project/beautifulsoup4/)