Skip to content

JavaScript Rendering

Harsimran Sidhu edited this page Jul 15, 2026 · 1 revision

JavaScript Rendering

Some modern sites do not expose their real links and assets until JavaScript runs. For those, Website Downloader can render each page with a headless Chromium browser (via Playwright) before parsing it.

When you need it

Use rendering when a normal crawl only captures an empty app shell or misses client-rendered links — typical of React, Vue, Angular, and Next.js sites.

If a plain crawl already captures the content you need, skip rendering: it is much slower and heavier than the default requests + BeautifulSoup path.

Setup

pip install "website-downloader[render]"
playwright install chromium

Usage

website-downloader --url https://example.com --render-js --max-pages 20

--headless is a friendly alias for --render-js.

Tuning

Flag Default Notes
--render-wait-until networkidle When Playwright considers navigation complete: commit, domcontentloaded, load, or networkidle. Use networkidle for SPAs that load data after initial paint; use load or domcontentloaded for faster runs on simpler pages.
--render-timeout-ms 30000 Navigation timeout per page in milliseconds. Increase for slow pages.

Important notes

  • Single-threaded. Playwright's synchronous API is single-threaded, so --page-threads is automatically forced to 1 when rendering is enabled. Asset downloads (--threads) still run concurrently.
  • Cookies and headers you pass are applied to the browser context, so authenticated rendering works.
  • Heavier footprint. Each page launches a real browser navigation, so rendering large sites takes noticeably longer than the default path.

See also: CLI Reference, Troubleshooting and FAQ.

Clone this wiki locally