Beautiful Soup
Open-source Python library for parsing and extracting data from HTML.
Overview
Beautiful Soup is an open-source (MIT) Python library for pulling data out of HTML and XML. It turns a document into a tree that code can search, navigate and modify. Developers use it in scrapers to extract text, links and tables from pages. It copes with badly formed markup and detects character encodings on its own.
Leonard Richardson wrote the library and still maintains it. It installs from PyPI with pip. It does not download pages, so scrapers pair it with an HTTP client. It runs on Python's built-in parser or on third-party parsers that are faster or more lenient. Companies can get commercial support through a Tidelift subscription.
Pros and cons
Pros
- Pro: Turns broken, unclosed HTML into a tree
- Pro: MIT license, free for commercial use
- Pro: Choice of html.parser, lxml or html5lib
- Pro: CSS selectors via the Soup Sieve dependency
- Pro: Detects each document's encoding and decodes it to Unicode automatically
Cons
- Con: Doesn't fetch pages on its own
- Con: Can't see content rendered by JavaScript
- Con: Slower than working with lxml directly
- Con: Code and bug tracker live on Launchpad, with no GitHub repository
Pricing
Pricing model
Free
Starts at
Free
Free tier
Available
Free and open source. Prices are in USD and can change; check the provider for current details.
Frequently asked questions
Is Beautiful Soup free?
Yes. Beautiful Soup is free and open source under the MIT license. It installs with pip install beautifulsoup4, and the license also allows copying the bs4 directory straight into an application. Companies that want commercial support can get it through a Tidelift subscription.
Which parser should I use with Beautiful Soup?
lxml, if it can be installed. The documentation recommends it for speed. Python's built-in html.parser needs no extra install and has decent speed. html5lib parses pages the way a web browser does but is very slow. XML parsing requires lxml ("xml" or "lxml-xml"). Different parsers can build different trees from invalid HTML.
Can Beautiful Soup download web pages?
No. Beautiful Soup only parses markup passed in as a string or an open file. Scrapers usually fetch pages first with an HTTP client such as requests or httpx. It does not run JavaScript, so pages that render content in the browser need a headless browser to produce the final HTML.
Is Beautiful Soup slow?
It is slower than the parser underneath it. The documentation says it will never be as fast as the parsers it sits on top of, and suggests using lxml directly when speed is critical. Choosing lxml as the parser helps most. Installing cchardet speeds up encoding detection, and SoupStrainer parses only part of a page to save memory.
What is the latest version of Beautiful Soup?
As of November 2026 the latest release is 4.15.0, published on PyPI on June 7, 2026. It requires Python 3.7 or later. The package is beautifulsoup4 and imports as bs4. The older BeautifulSoup package is Beautiful Soup 3, which is discontinued and does not support Python 3.
Is Beautiful Soup on GitHub?
No. Development happens on Launchpad, which hosts the Git repository and the bug tracker. Leonard Richardson is the project's maintainer. Security vulnerabilities are reported confidentially through Tidelift.
Sources
James Carter
Web Data Expert
James researches the tools teams use to collect data from the web, from hosted browsers to scraping platforms and open-source crawlers. Each review looks at how a tool holds up in production and what it costs.