DEV.co
AI Frameworks · adbar

trafilatura

Trafilatura is a Python tool for discovering, downloading, and extracting text and metadata from web pages. It handles crawling, HTML parsing, and outputs structured data in multiple formats (JSON, CSV, Markdown, HTML, XML), making it useful for building text corpora and content pipelines.

Source: GitHub — github.com/adbar/trafilatura
6.3k
GitHub stars
393
Forks
Python
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryadbar/trafilatura
Owneradbar
Primary languagePython
LicenseApache-2.0 — OSI-approved
Stars6.3k
Forks393
Open issues74
Latest releasev2.1.0 (2026-06-07)
Last updated2026-07-01
Sourcehttps://github.com/adbar/trafilatura

What trafilatura is

Python package providing web crawling (sitemap/feed support), robust HTML-to-text extraction using pattern matching and algorithms like jusText and readability, parallel processing, and configurable metadata extraction (title, author, date, categories). Outputs to TXT, Markdown, CSV, JSON, HTML, XML-TEI with optional language detection.

Quickstart

Get the trafilatura source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/adbar/trafilatura.gitcd trafilatura# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

News aggregation and corpus building

Extract main text and metadata from news articles at scale; used by institutions like Stanford and Allen Institute for research data acquisition.

Content pipeline preprocessing

Clean and structure HTML content before feeding to NLP, RAG, or LLM systems; removes boilerplate and normalizes formats.

Web scraping and data extraction workflows

Crawl sitemaps/RSS feeds, download pages, extract structured content, and export to CSV/JSON for downstream processing.

Implementation considerations

  • Extraction quality varies by site structure; configure settings (include comments, optional elements) and test on target domains.
  • No built-in JavaScript rendering; pair with Selenium/Playwright for JS-heavy sites or use pre-rendered HTML.
  • Language detection is optional and requires additional dependencies; evaluate performance on multilingual corpora.
  • Memory usage grows with batch size; use parallel processing and pagination for large crawl jobs.
  • Output formats are flexible but TEI and XML variants require familiarity with those schemas if used downstream.

When to avoid it — and what to weigh

  • Heavy JavaScript-rendered content — Trafilatura works with static HTML; JavaScript-heavy sites require headless browser integration (not built-in).
  • Real-time, low-latency extraction — Designed for batch and crawl workflows; single-page extraction is reasonably fast but not optimized for microsecond latencies.
  • Complex table or image extraction — While tables and images are supported, extraction is basic; specialized layout-aware tools may be needed for dense structured data.
  • Legal/compliance scraping without review — Tool does not include robots.txt compliance or rate-limiting enforcement; user responsible for respecting site policies and laws.

License & commercial use

Apache 2.0 license (current, v2.1.0). Versions prior to v1.8.0 were GPLv3+. Apache 2.0 is a permissive OSI-approved license allowing commercial use, modification, and distribution with liability disclaimers and patent protection.

Apache 2.0 permits commercial use, including in proprietary products. No license restrictions on distribution or modification. No warranty or support obligation from maintainer. For mission-critical deployments, evaluate maintenance cadence and consider contributing upstream or sponsoring the author.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Tool fetches and parses untrusted HTML; potential DoS from malformed or recursive structures. No built-in request validation or rate-limiting. User responsible for: respecting robots.txt, rate-limiting, SSL verification, storing sensitive extracted data securely. Consider sandboxing if extracting from untrusted sources. No security audit data provided.

Alternatives to consider

Readability (Mozilla/Arc90)

Simpler, JavaScript-based article extraction; less control over metadata and output formats; primarily DOM-focused.

Newspaper3k / Newspaper

Python article extractor with NLP; smaller feature set for crawling and format output; less active maintenance.

Scrapy

Full-featured web scraping framework; steeper learning curve; more suitable for custom multi-page extraction pipelines than standalone content extraction.

Software development agency

Build on trafilatura with DEV.co software developers

Trafilatura handles crawling, parsing, and structured output. Pair it with our AI and API development services to scale content pipelines and integrate with LLMs.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

trafilatura FAQ

Does Trafilatura respect robots.txt?
Not automatically. The tool provides URL filtering and crawling utilities, but the user must implement robots.txt checking and rate-limiting logic.
Can it extract from JavaScript-rendered pages?
No. Trafilatura parses static HTML. For JavaScript-heavy sites, render with Selenium/Playwright first, then pass HTML to Trafilatura.
What Python versions are supported?
Badge on README indicates support across multiple versions (see PyPI page). Minimum is Python 3.6+; check latest release notes for exact range.
Is there a Docker image or deployment package?
Not clearly stated in provided data. Check GitHub releases or Docker Hub. For containerized use, build your own image with Trafilatura installed.

Custom software development services

DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If trafilatura is part of your ai frameworks roadmap, our team can implement, customize, migrate, and maintain it.

Ready to build a web extraction pipeline?

Trafilatura handles crawling, parsing, and structured output. Pair it with our AI and API development services to scale content pipelines and integrate with LLMs.