A web crawler that fetches HTML content, converts it to Markdown, and processes it with mq queries.
Why mq-crawler?
Make web scraping and content extraction effortless with intelligent Markdown conversion:
- HTML to Markdown: Automatically convert crawled HTML pages to clean, structured Markdown
- Ethical Crawling: Built-in robots.txt compliance to crawl responsibly
- mq Integration: Process crawled content with powerful mq queries for filtering and transformation
- JavaScript Support: Browser-based crawling with WebDriver for dynamic content
- High Performance: Parallel processing with configurable concurrency for faster crawling
- Flexible Output: Save to files or stream to stdout
Features
- 🌐 Web Crawling: Fetch and process web pages with configurable depth and delay
- 🔄 HTML to Markdown: Automatic conversion with customizable options
- 🤖 Robots.txt Compliance: Respects robots.txt rules for ethical crawling
- 🔍 mq Query Integration: Filter and transform crawled content on-the-fly
- 🚀 Parallel Processing: Concurrent workers for faster crawling
- 🎯 Depth Control: Limit crawl depth to control scope
- ⏱️ Rate Limiting: Configurable delays to avoid overloading servers
- 📊 Statistics: Track crawling progress and results
- 🌐 WebDriver Support: Use Selenium WebDriver for JavaScript-heavy sites
Installation
Homebrew
Cargo
From Source
Usage
Basic Crawling
# Crawl a website and output to stdout
# Save crawled content to directory
# Crawl with custom delay (default: 0.5 seconds)
# Limit crawl depth
Processing with mq Queries
# Extract only headings from crawled pages
# Extract all code blocks
# Extract and transform links
Parallel Crawling
# Crawl with 3 concurrent workers
# High-speed crawling with 10 workers
Custom Robots.txt
# Use custom robots.txt file
HTML to Markdown Options
# Extract scripts as code blocks
# Generate YAML front matter with metadata
# Use page title as H1 heading
# Combine multiple options
Output Formats
# Output as JSON
# Output as text (default)
Browser-Based Crawling
For JavaScript-heavy sites, use WebDriver (requires Selenium):
# Start Selenium server first
# docker run -d -p 4444:4444 selenium/standalone-chrome
# Crawl with WebDriver
# Custom timeouts
Command Line Options
<URL> The
)
)
)
)
Development
Building from Source
Running Tests
Support
License
Licensed under the MIT License.