Stay up to date with AI tools, model releases, and developer workflows that matter.
Weekly. Free. One click to leave.
7 Day Free Trial. Cancel Anytime.
Run Apple's MacBook Air page through trafilatura, a Python library that pulls the main text out of web pages, and you get 106 words back. The page has more than 7,000 words of visible text. If you build retrieval-augmented generation (RAG), that gap decides what your model can find.
Sources indicate that the team at Apify, which makes one of the three tools compared below, turned 20 public web pages into Markdown three ways and measured what broke. The numbers in this article come from that test. SitePoint's guide on building a fetch layer for AI agents covers getting the page. This article picks up where it leaves off, at the line "extract_main_text is whatever readability or boilerplate-removal step you already use". Here's what breaks in that step and the Python to fix each problem.
The test used four pages each of five types: documentation (Python, MDN, FastAPI, GitHub), blog posts, news and Wikipedia articles, product pages (Apple, a GitHub repository, Allbirds, IKEA), and pages that render with JavaScript (crates.io, Bluesky, Mastodon, a Notion help page).
Each page went through three methods on November 5, 2026:.
[IMAGE: Bar chart: total tokens for the same 20 pages: plain conversion 210,158, Website Content Crawler 106,332, trafilatura 62,236].
It has been revealed that total tokens after converting the same 20 pages. Test run on November 5, 2026.
It has been revealed that no method won on every page. The rest of this article goes through the failures one at a time.
The first thing most people write looks like this:.
A main-content extractor scores each block of the page and keeps the ones that look like the body:.
On articles this works well. Across all 20 pages, boilerplate lines fell from 179 to 8, and total tokens fell by 70%. The trouble starts on pages that aren't articles.
Extractors like this are built around articles. Product pages, landing pages, and repository pages don't look like that, so the extractor keeps a fragment and drops the rest:.
Setting trafilatura's favor_recall=True made no real difference on any of the three.
The fix is to notice the problem per page. Compare what the extractor kept with how much text the page has:.
For pages flagged extractor_dropped_content, fall back to converting the page's main region with the obvious noise removed:.
Industry observers note that in the test set, diagnose sent Apple, Allbirds, and the Notion help page to the fallback, and marked the three JavaScript shells from Problem 3 as needs_browser. The fallback brought Apple from 106 words to 3,845, Allbirds from 200 to 921, and Notion from 45 to 195. It's a blunter tool than the extractor, so use it only as a fallback. The 15% threshold is a judgment call: IKEA kept 17% and passed, even though the crawler found far more text. Tune it on your own pages.
Three of the four JavaScript pages in the set build their content in the browser, so the HTML that requests gets is an app shell with almost no text (the Notion help page had enough text in its HTML to pass):.
[IMAGE: Grouped bar chart of words kept per page by trafilatura and Website Content Crawler: Apple 106 vs 1,513, Allbirds 200 vs 1,244, IKEA 412 vs 3,238, crates.io 12 vs 278, Bluesky 26 vs 135, Mastodon 21 vs 2,283].
Words kept per page on the product and JavaScript pages.
In a recent development, rendering does not mean you are done, though. When the function was rerun as a check, crates.io came back with 278 words again, but the Bluesky profile came back with 9 words instead of 135. Pages like that can load content in stages, so check the rendered output too. The crawler returns Markdown, not HTML, so a word count is enough: retry or wait longer if it's still thin. Website Content Crawler has a waitForSelector setting for this case.
According to recent reports, if you'd rather run the browser yourself, Playwright does the rendering part. Install it with pip install playwright and playwright install chromium, then pass the rendered HTML through the same main_region_markdown fallback from Problem 2:.
Word counts tell you whether text survived. They don't tell you whether the structure did, and RAG depends on structure. Headings become chunk boundaries, code needs its indentation, and a table that turns into a run of numbers can't answer "what's the limit for X".
Between them, two pages in the set showed all three problems with trafilatura:.
Industry observers note that website Content Crawler kept 13 of the GitHub headings and all 17 table rows on the Python page. It isn't perfect either. On the Python page it kept 11 of 17 headings, and its code examples kept their indentation but came out as plain text, without code fences and with characters like [ and = escaped. On a short post by Simon Willison it kept 30 words where trafilatura kept 77.
So check structure on every page, whatever tool you use:.
Industry observers note that for the GitHub page and trafilatura, it returns "headings": (19, 0). Log pages where the second number is far below the first, and route them to a different method.
Extractors judge each page on its own by default (trafilatura has an optional deduplicate setting), so they don't see that a block appears on every page of a site. When you index a whole docs site, the menu, breadcrumbs, and "Skip to content" links get embedded once per page. Look at the site as a whole instead:.
In a recent development, in an extra test outside the 20-page set, on four GitHub REST docs pages converted with plain markdownify, this removed 79 blocks from the first page alone ("Skip to main content", "Menu", "Collapse sidebar") and cut the four pages from 34,207 tokens to 19,606, a 43% drop. On four Python library docs pages it removed only 1.3%, because Python's navigation is small next to the content. Run it and measure; don't assume.
It has been revealed that set min_pages with care. On a small site, a real paragraph that appears on three pages (a shared warning, say) will be removed. Headings are blocks too, so a section title that repeats across pages, like "Parameters", goes as well. If you chunk by heading next, skip blocks that start with # when you count.
Sources indicate that the last step is splitting each page into chunks for embedding. Splitting every N tokens cuts sections in half and loses the heading that states what the text is about. Split on headings, keep the heading path with each chunk, and only split further when a section is too long:.
This is where Problem 4 comes back. The trafilatura output for the GitHub page gave 8 chunks, none with a section path, because it had no headings. The crawler's output gave 15 chunks, each labeled like "Rate limits for the REST API > About primary rate limits > Primary rate limit for unauthenticated people". Store section and url as metadata, and put the section path at the top of the text you embed.
According to recent reports, one limit: a single paragraph or code block longer than max_tokens stays whole. On the Python docs, one chunk was 1,137 tokens. Split those further if your embedding model needs it.
A pipeline that holds up on mixed pages looks like this:.
According to recent reports, the takeaway from this test: don't pick one converter for everything. trafilatura gave the leanest output overall. The rendering crawler was the only method that got the JavaScript pages, and it kept more of the docs structure than trafilatura, at the cost of a browser per page. The test didn't run trafilatura on rendered HTML, so part of that gap may come from rendering, not extraction, and some of trafilatura's lean output is content it dropped (Problem 2). The checks between the steps are what make either of them safe to use.
According to recent reports, every problem found in this test came from the conversion step: navigation embedded as content, product pages reduced to a paragraph, JavaScript pages indexed as empty, and docs without headings. Measure each page you convert, using word counts against the visible text and structure counts against the HTML, and send the failures down a different path. Start with the diagnose and structure_report functions above on a sample of your own pages. They run locally on HTML you already have and tell you which of these problems you have.
Markdown keeps headings, lists, tables, and code blocks, so your chunker can split on them and a large language model (LLM) can see the structure. Plain text loses that structure, and with it the chunk boundaries and section labels.
Keep them if your answers should cite or follow them. Drop them if they're mostly navigation. In the test, plain conversions had 5,444 links across 20 pages; after extraction, 909 were left.
According to recent reports, check each site's terms and robots.txt, identify your bot honestly, and keep request rates low. The fetch-layer guide linked above covers this in detail. Website Content Crawler has a setting to respect robots.txt, which was turned on for this test.
It has been revealed that there's no single right size. The examples here use 400 tokens as a limit and headings as the main boundary. Test a few sizes against real questions from your users and keep the one that retrieves the right section most often.
Recent findings suggest that 7 Day Free Trial. Cancel Anytime.
