Skip to main content

html-docs-crawler

A Scrapy-based universal documentation crawler that converts HTML documentation sites to Markdown format, with automatic internal link rewriting to local .md relative paths. Supports multiple converter engines (markitdown / html2text), path whitelist filtering, and automatic media file download.

Parameters

  • start_urls: Starting URLs (comma-separated)
  • allowed_domains: Allowed domains (comma-separated)
  • deny_patterns: Regex deny patterns (comma-separated)
  • allow_paths: Allowed path prefixes (comma-separated); only URLs starting with these prefixes will be processed
  • body_selector: CSS selector for main HTML content (default: "main, article, .content, .document, .body, body")
  • output_dir: Output directory (default: "~/.config/doc_crawler/_docs/{domain_name}", where {domain_name} is extracted from start_urls)
  • converter_engine: Converter engine (default: "markitdown", optional: "html2text")
  • single_page: Single-page mode (default: "false", set to "true" to crawl a single page without following links)

Install via UV

uv tool install html-docs-crawler

After installation, you can use the doc_crawler command from any directory.

Usage Examples

# Crawl AKShare documentation
doc_crawler --start-urls "https://akshare.akfamily.xyz" \
  --allowed-domains "akshare.akfamily.xyz" \
  --deny-patterns "/_sources/" \
  --body-selector "main, article, .content, .document, .body" \
  --output-dir "_docs/akshare_markdown"

Single-page mode

doc_crawler --start-urls "https://build123d.readthedocs.io/en/stable/examples_1.html" \
  --single-page true \
  --body-selector ".wy-nav-content" \
  --output-dir "single_page_output"

Path whitelist filtering

doc_crawler --start-urls "https://opencode.ai/docs/zh-cn/" \
  --allow-paths "/docs/zh-cn/" \
  --body-selector "main, article, .content" \
  --output-dir "_docs/opencode_docs_zh_cn"

Crawl with html2text engine

doc_crawler --start-urls "https://akshare.akfamily.xyz/" \
  --allowed-domains "akshare.akfamily.xyz" \
  --deny-patterns "/_sources/" \
  --body-selector "main, article, .content, .document, .body" \
  --converter-engine "html2text" \
  --output-dir "_docs/akshare_markdown_html2text"

More examples

# Crawl build123d docs
doc_crawler --start-urls "https://build123d.readthedocs.io/en/stable/" \
  --deny-patterns "/_sources/,/latest/" \
  --body-selector ".wy-nav-content" \
  --output-dir "_docs/build123d"

# Crawl Docusaurus docs
doc_crawler --start-urls "https://docusaurus.io/docs" \
  --allow-paths "/docs" \
  --body-selector ".col.docItemCol_n6xZ" \
  --output-dir "_docs/docusaurus"

# Crawl uv documentation
doc_crawler --start-urls "https://docs.astral.sh/uv/" \
  --body-selector ".md-content" \
  --output-dir "_docs/uv"

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

html_docs_crawler-0.2.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

html_docs_crawler-0.2.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file html_docs_crawler-0.2.0.tar.gz.

File metadata

  • Download URL: html_docs_crawler-0.2.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for html_docs_crawler-0.2.0.tar.gz
Algorithm Hash digest
SHA256 173491a586bad46b346a1a58d77ca94d4d062af989e224fe2c277aede20f9044
MD5 def53f3ceda9ffaed87c7c82c7d0478f
BLAKE2b-256 69843d044d5d9a4402b953a9161de0a2c4ef9274806b4a24cc522b9c6d3c9479

See more details on using hashes here.

File details

Details for the file html_docs_crawler-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: html_docs_crawler-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for html_docs_crawler-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0fdfec7eb304a37b665ca72fb55f9ee534792b97112b5369b8fb6f43efec5c
MD5 5a2fd779a2e859f7c96231b5e60677db
BLAKE2b-256 5265fddf6ac35a49ce41dc07579799c188a18d5b141b8aa87cd535bd52fbd490

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page