Skip to content

Cookbook

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

Cookbook

Copy-paste recipes for common tasks. On Windows cmd, the line-continuation character is ^; on macOS/Linux use \.

Mirror a small public site

website-downloader --url https://example.com --destination example_backup --max-pages 50

Speed up a large mirror

website-downloader --url https://example.com --max-pages 500 --page-threads 4

--page-threads defaults to 1 to stay polite. Raise it only for sites that tolerate concurrent requests. See CLI Reference.

Seed from a sitemap

website-downloader --url https://example.com --sitemap
website-downloader --url https://example.com --sitemap https://example.com/sitemap.xml

Omitting the value uses /sitemap.xml. Nested sitemap indexes are followed automatically.

Download approved CDN assets

website-downloader \
  --url https://example.com \
  --destination example_backup \
  --download-external-assets \
  --external-domains cdn.example.com fonts.gstatic.com

See External Assets and CDN.

Mirror an authorized site with cookies

website-downloader \
  --url https://intranet.example.com \
  --destination intranet_backup \
  --cookie-file example-cookie.txt

Cookie files use normal cookie-header syntax:

sessionid=abc123; csrftoken=xyz789

Send custom headers (bearer tokens, staging headers)

website-downloader \
  --url https://docs.example.com \
  --destination docs_backup \
  --header "Authorization: Bearer <token>" \
  --header "X-Environment: staging"

Render a JavaScript site

pip install "website-downloader[render]"
playwright install chromium
website-downloader --url https://example.com --render-js --max-pages 20

See JavaScript Rendering.

Polite, careful crawl

website-downloader \
  --url https://example.com \
  --max-pages 50 \
  --threads 4 \
  --delay 0.25 \
  --respect-robots \
  --max-asset-bytes 25000000 \
  --user-agent "WebsiteDownloader/1.0"

Update an existing mirror

website-downloader --url https://example.com --destination example_backup --update

Unchanged resources are skipped via ETag / Last-Modified. See Incremental Updates.

Export a portable archive

website-downloader \
  --url https://example.com \
  --destination example_backup \
  --zip-output example_backup.zip \
  --warc-output example_backup.warc

See Exports Zip and WARC.

Clone this wiki locally