Trafilatura is packaged as a software library available from PyPI and runs on Linux, macOS, and Windows. The standard installation takes under a minute and gives you both the Python API and theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/adbar/trafilatura/llms.txt
Use this file to discover all available pages before exploring further.
trafilatura CLI command.
Prerequisites
Trafilatura requires Python 3.10 or higher. To check which version is available on your system, run:Basic Installation
import trafilatura in Python and the trafilatura CLI command are available.
Upgrading
Trafilatura is under active development. Keep it up to date to benefit from the latest improvements:Optional Extras
A handful of third-party packages extend Trafilatura’s functionality. You can install all of them at once with the[all] extra, or add individual packages as needed:
Everything works even if not all optional packages are installed. Trafilatura detects which packages are present and automatically uses the best available combination.
| Extra package | What it adds |
|---|---|
brotli | Brotli compression support for downloads |
faust-cchardet | Faster and more accurate encoding detection (especially for Asian encodings) |
htmldate[speed] | Faster and more precise publication-date extraction |
py3langid | Language detection on the extracted main text |
pycurl | Faster HTTP downloads; useful where urllib3 falls short |
urllib3[socks] | SOCKS proxy support for downloads |
zstandard | Zstandard compression support for downloads |
Older Python Versions
If you need to run Trafilatura on a Python version older than 3.10, install a specific older release:| Python version | Last compatible Trafilatura release |
|---|---|
| 3.6 / 3.7 | 1.12.2 |
| 3.5 | 0.9.3 |
| 3.4 | 0.8.2 |
Troubleshooting
CLI entry point not found
If the library installs successfully but thetrafilatura command is not recognised in your terminal, the Python user-level bin directory may not be on your PATH.
Linux / macOS:
~/.bashrc, ~/.zshrc, etc.) to make it permanent. For more details, see the official Python documentation on user installations.
Windows:
Refer to the Stack Overflow guide on finding pip-installed executables for Windows-specific instructions.
macOS — Homebrew alternative
Next Steps
Quickstart
Extract your first web page with Python or the CLI in under five minutes.
Introduction
Learn what Trafilatura can do and how it fits into the broader ecosystem.