Show HN: Doc-scraper, offline searchable docs corpora for coding agents (Go) Doc-scraper, a configurable, concurrent, and resumable web crawler written in Go, has been released as an open-source tool on GitHub to scrape technical documentation websites and convert them into clean Markdown for ingestion by large language models (LLMs). The tool, created by Sriram-PR, supports features such as content extraction via CSS selectors, HTML-to-Markdown conversion, resumable crawls, rate limiting, and optional JSONL output for RAG systems, with a stated goal of automating the collection and cleaning of web-based documentation for LLM training and retrieval-augmented generation. A configurable, concurrent, and resumable web crawler written in Go. Specifically designed to scrape technical documentation websites, extract core content, convert it cleanly to Markdown format suitable for ingestion by Large Language Models LLMs , and save the results locally. This project provides a powerful command-line tool to crawl documentation sites based on settings defined in a config.yaml file. It navigates the site structure, extracts content from specified HTML sections using CSS selectors, and converts it into clean Markdown files. - Built for LLM Training & RAG Systems - Creates clean, consistent Markdown optimized for ingestion - Preserves Documentation Structure - Maintains the original site hierarchy for context preservation - Production-Ready Features - Offers resumable crawls, rate limiting, and graceful error handling - High Performance - Uses Go's concurrency model for efficient parallel processing The main objective of this tool is to automate the often tedious process of gathering and cleaning web-based documentation for use with Large Language Models. By converting structured web content into clean Markdown, it aims to provide a dataset that is: - Text-Focused: Prioritizes the textual content extracted via CSS selectors - Structured: Maintains the directory hierarchy of the original documentation site, preserving context - Cleaned: Converts HTML to Markdown, removing web-specific markup and clutter - Locally Accessible: Provides the content as local files for easier processing and pipeline integration | Feature | Description | |---|---| | Configurable Crawling | Uses YAML for global and site-specific settings | | Scope Control | Limits crawling by domain, path prefix, and disallowed path patterns regex | | Content Extraction | Extracts main content using CSS selectors | | HTML-to-Markdown | Converts extracted HTML to clean GitHub-Flavored Markdown tables, task lists, strikethrough | | Image Handling | Opt-in downloading and local rewriting of image links with domain and size filtering disabled by default; doc-scraper is text-first | | Link Rewriting | Rewrites internal links to relative paths for local structure | | JSONL Output | Optional one-record-per-page JSONL with a trailing crawl-summary record, for RAG ingestion | | Concurrency | Configurable worker pools and semaphore-based request limits global and per-host | | Rate Limiting | Configurable per-host delays with jitter | | Robots.txt & Sitemaps | Respects robots.txt and processes discovered sitemaps | | State Persistence | Uses BadgerDB for state; supports resuming crawls via crawl --resume | | Graceful Shutdown | Handles SIGINT / SIGTERM with proper cleanup | | HTTP Retries | Exponential backoff with jitter for transient errors | | Observability | Structured logging log/slog ; optional pprof endpoint build with -tags pprof | | Modular Code | Organized into packages for clarity and maintainability | | CLI Utilities | Built-in config validate and config list commands for configuration management | | MCP Server Mode | Expose as Model Context Protocol server for Claude Code/Cursor integration | | Full-Text Search | Offline BM25 search over crawled docs SQLite FTS5 via the search docs MCP tool | | Auto Content Detection | Automatic framework detection Docusaurus, MkDocs, Sphinx, GitBook, ReadTheDocs with readability fallback | | Parallel Site Crawling | Crawl multiple sites concurrently with shared resource management | | Watch Mode | Scheduled periodic re-crawling with state persistence | - Go: Version 1.26 or later - Git: For cloning the repository - Disk Space: Sufficient for storing crawled content and state database Option 1: Direct Installation Recommended Install the latest version directly from GitHub: go install github.com/Sriram-PR/doc-scraper/v2/cmd/doc-scraper@latest This installs the doc-scraper binary to your GOPATH/bin directory usually ~/go/bin or %USERPROFILE%\go\bin . Make sure this directory is in your PATH . Option 2: Clone and Build 1. Clone the repository: git clone https://github.com/Sriram-PR/doc-scraper.git cd doc-scraper 2. Install Dependencies: go mod tidy 3. Build the Binary: make build or: go build -o doc-scraper ./cmd/doc-scraper This creates an executable named doc-scraper in the project root. Create a minimal config.yaml in the project root: output base dir: "./crawled docs" state dir: "./crawler state" enable jsonl output: true sites: rust cli book: start urls: - "https://rust-cli.github.io/book/index.html" allowed domain: "rust-cli.github.io" allowed path prefix: "/book/" content selector: " content, main" max depth: 2 seed plus one level; set 0 for the whole book Run the crawl: ./doc-scraper crawl -site rust cli book -loglevel info The Markdown, plus pages.jsonl , llms.txt , and llms-full.txt , lands under ./crawled docs/rust cli book/ output is organized by site key . A small book like this finishes in a few seconds; large sites can take minutes, so start with a low max depth to gauge size before removing the bound. A config.yaml file is required to run the crawler. Create this file in the project root or specify its path using the -config flag. When configuring for LLM documentation processing, pay special attention to these settings: - sites.