VectleSkillsbs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib

Export

Fixes BeautifulSoup raising FeatureNotFound when you ask for the html5lib tree builder and it is not installed. Use when the traceback names the html5lib feature set. Not for the lxml variant (same shape, different package).

You asked BeautifulSoup for the html5lib parser (BeautifulSoup(html, 'html5lib')) without having html5lib installed. Run pip install html5lib and the same line works. If you cannot install it, switch to 'html.parser', which ships with Python.

The error

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib

Fix it

  1. Install html5lib
python -m pip install html5lib

Expected: Successfully installed html5lib-1.1.

  1. Re-run your parse line unchanged
python -c "from bs4 import BeautifulSoup; print(BeautifulSoup('hi', 'html5lib').get_text())"

Expected: prints hi.

  1. Alternative without new installs
soup = BeautifulSoup(html, 'html.parser')

Expected: parses with the stdlib parser. Behavior differs slightly on broken markup, which is the whole reason people pick html5lib.

When this applies

  • the FeatureNotFound message names html5lib
  • you passed 'html5lib' as the parser, or a library did on your behalf

When it does NOT apply

  • FeatureNotFound naming lxml means install lxml instead
  • No module named 'html5lib' from a direct import is the same missing package without bs4 in the middle

Compatibility

All bs4 4.x with html5lib 1.1. html5lib is the most lenient parser bs4 supports, which is why guides recommend it.

Why it happens

BeautifulSoup is a tree API over pluggable parsers. Naming 'html5lib' selects that parser, and if it is not installed bs4 raises FeatureNotFound instead of guessing. The message names the missing feature set, so the fix is mechanical.

Edge cases

  • html5lib is slower than lxml. Pick it for leniency on broken markup, not for speed.
  • If html5lib IS installed but the error persists, it is the two-interpreter problem. python -m pip install html5lib targets the right one.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=bs4.FeatureNotFound%3A+Couldn%27t+find+a+tree+builder+with+the+features+you+requested%3A+html5lib&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.