Stop Reaching for a Headless Browser to Scrape Documentation Sites A developer outlines lightweight alternatives to headless browsers for scraping documentation sites, noting that static site generators like Next.js and Docusaurus leave content in predictable places such as __NEXT_DATA__ tags or pre-rendered HTML. The post recommends checking the initial HTML response, using curl to verify content presence, and sparse-cloning markdown from public repos for cleaner input, while cautioning about license checks. Every few days someone in a scraping forum asks a version of the same question: "I'm collecting documentation text for an AI tool, but the pages render with JavaScript. What's the lightest way to get the content?" The answers are always the same — open DevTools, check the Network tab, find the XHR. That advice is correct, and for documentation sites specifically it's usually unnecessary work. Documentation sites are not arbitrary web apps. They're overwhelmingly built by a handful of static site generators, and those generators leave the content sitting in predictable places. Three routes cover most of what you'll hit, and none of them need a browser. Next.js-based docs which includes a large share of company developer portals embed the full page payload in a NEXT DATA script tag. It's in the initial HTML response — no JavaScript execution needed. python import json, re, httpx html = httpx.get url, follow redirects=True .text m = re.search r'