Back
42/65
Lesson 42
5 min
MDWB: Web to Markdown
Convert web pages to clean Markdown for AI consumption
Ready to level up?
Mark complete to track your learning progress.
Convert web pages to clean Markdown for AI consumption
Mark complete to track your learning progress.
Convert web pages into clean Markdown that AI agents can read and reason about.
MDWB (Markdown Web Browser) renders web pages in headless Chrome, OCRs the screenshots, and returns Markdown with per-tile provenance. The result is perfect for feeding into LLMs as context.
When AI agents need information from the web, raw HTML is noisy and token-expensive, and JavaScript-heavy pages often hide their content from plain scrapers. MDWB captures what the page actually shows, preserving headings, code blocks, lists, and links in a format LLMs handle efficiently. The mdwb CLI is a Python client for a local MDWB server, which needs an OCR endpoint and API key configured.
Works with most websites
Markdown with per-tile provenance
Preserves code formatting
Headless Chrome + OCR pipeline (Python)
Web-to-Markdown Conversion Studio
A simplified view of page content becoming clean Markdown (MDWB itself renders the page in headless Chrome and OCRs screenshot tiles)
Submit a URL as a capture job, then read the Markdown snapshot back by job id.
# Capture a web page (streams progress, prints the job id)mdwb fetch "https://docs.example.com/api/reference" --watch# Print the Markdown for that jobmdwb jobs result <job-id># Save it to a filemdwb jobs result <job-id> > guide.md# Pipe directly to an AI agentmdwb jobs result <job-id> | claude "summarize this API"
MDWB shines when you need web content in LLM-friendly format.
# Research a library's docs before using itmdwb fetch "https://docs.rs/tokio/latest" --watchmdwb jobs result <job-id> > tokio-docs.md# Get error context from StackOverflowmdwb fetch "https://stackoverflow.com/questions/12345" --watchmdwb jobs result <job-id> > context.md# Crawl a docs site one level deepmdwb crawl "https://blog.example.com/architecture-decisions"# Capture several pages as one tagged batch, then search across themmdwb batch --url "https://docs.example.com/a" --url "https://docs.example.com/b" --tag researchmdwb search "architecture" --tag research | claude "analyze these documents"
MDWB connects web knowledge to the agent workflow.
Encode a job's JSON result as TOON to save tokens
Index downloaded pages for local semantic search
Archive both web pages and AI conversations
Feed research papers into Brenner corpus