Overview
Best for:- Any text content (articles, blogs, documentation)
- Sites with complex HTML structure
- Minimal metadata requirements
- High accuracy content extraction
- Excellent accuracy (removes boilerplate reliably)
- Fast extraction
- Works on varied HTML structures
- Lightweight
- Less metadata than newspaper4k
- Not suitable for non-text content (e-commerce, listings)
Configuration
Enable inEXTRACTOR_ORDER:
Extracted Fields
Standard Fields
Metadata Fields
Example Output
Fallback Behavior
Trafilatura fails when content extraction returns empty or < 100 characters.Performance
Speed: Fast (pure Python, in-memory processing) Recommended concurrency:When to Use
Use Trafilatura When:
Need highest accuracy content extraction
Dealing with complex HTML layouts
Metadata is not critical
Any text-based content (not just news)
Want lightweight, fast extraction
Don’t Use Trafilatura When:
Comparison with Newspaper
Recommendation: Use both with fallback
- Newspaper extracts rich metadata
- Trafilatura catches pages newspaper misses
Debugging
Check if trafilatura succeeded:source: trafilatura in output.
Test extraction:
Configuration Examples
Primary Extractor
With Newspaper Fallback
After Playwright Rendering
Documentation Site
Advanced Usage
Infinite Scroll with Trafilatura
- Playwright scrolls page to load all content
- Trafilatura extracts combined content from full page
Related
- Extractors Overview - Strategy selection
- Newspaper Extractor - Alternative generic extractor
- Playwright Extractor - Browser rendering
- Custom Extractors - Site-specific extraction
- Settings - Configuration options