| Field | Description |
|---|---|
| Crawled | Total URLs discovered and processed |
| Success | URLs successfully fetched and parsed |
| Failed | URLs that couldn't be fetched |
| In Progress | URLs currently being processed |
QUICK START GUIDE
Get up and running with Omnivore in just a few minutes. This guide will walk you through your first crawl, data extraction, and knowledge graph creation.
Prerequisites
Make sure you have Omnivore installed. If not, check the Installation Guide first.
Step 1: Your First Crawl
Let's start with a simple website crawl.
BASH001# Basic crawl with default settings002omnivore crawl https://httpbin.org/html
Add More Options
BASH001# Crawl with more workers and depth002omnivore crawl https://example.com \003 --workers 5 \004 --depth 3 \005 --delay 200 \006 --output results.json007008# This will:009# - Use 5 parallel workers010# - Crawl up to 3 levels deep011# - Wait 200ms between requests012# - Save results to results.json
Understanding the Output
Step 2: Parse Specific Content
Extract specific data from HTML using custom parsing rules.
Create a Parser Configuration
BASH001# Create a parser config file002cat > parser-rules.yaml << EOF003rules:004 - name: "title"005 selector: "title"006 required: true007 - name: "headings"008 selector: "h1, h2, h3"009 multiple: true010 - name: "links"011 selector: "a[href]"012 attribute: "href"013 multiple: true014EOF
Parse with Custom Rules
BASH001# Parse a specific HTML file002omnivore parse index.html --rules parser-rules.yaml003004# Parse from URL and extract data005curl -s https://example.com | omnivore parse --rules parser-rules.yaml
Step 3: Build Knowledge Graphs
Transform your crawled data into a knowledge graph for deeper analysis.
BASH001# Build a knowledge graph from crawl results002omnivore graph results.json --output knowledge-graph.db003004# Query the knowledge graph005omnivore graph-query knowledge-graph.db \006 --query "MATCH (n:Website)-[r:LINKS_TO]->(m:Website) RETURN n, r, m LIMIT 10"
Step 4: Analyze Git Repositories
Extract and analyze source code from Git repositories with intelligent filtering.
BASH001# Analyze a GitHub repository002omnivore git https://github.com/rust-lang/cargo --output cargo-analysis.txt003004# Analyze your local project005omnivore git . --output my-project.txt006007# Extract specific file types008omnivore git ./my-project --only "*.py,*.md" --output python-docs.txt009010# Exclude test files011omnivore git ./my-project --exclude "**/tests/**" --output src-only.txt
Common Use Cases
1. News Site Monitoring
BASH001# Monitor a news website for new articles002omnivore crawl https://news.ycombinator.com \003 --workers 3 \004 --depth 2 \005 --respect-robots \006 --output hn-$(date +%Y%m%d).json007008# Extract article data with custom rules009omnivore parse hn-*.json --rules news-extractor.yaml
2. E-commerce Product Scraping
BASH001# Scrape product information (respect rate limits!)002omnivore crawl https://example-store.com/products \003 --workers 2 \004 --delay 1000 \005 --depth 3 \006 --output products.json007008# Parse product data009omnivore parse products.json --rules product-extractor.yaml
3. Research Paper Collection
BASH001# Collect academic papers002omnivore crawl https://arxiv.org/list/cs.AI/recent \003 --workers 5 \004 --depth 2 \005 --output papers.json006007# Build citation network008omnivore graph papers.json \009 --schema academic-papers \010 --output citation-network.db
4. Code Repository Analysis
BASH001# Analyze open source project structure002omnivore git https://github.com/facebook/react --output react-codebase.txt003004# Extract documentation from a project005omnivore git ./my-project --only "*.md,*.rst,*.txt" --output docs.txt006007# Generate code report with JSON output008omnivore git ./my-project --json --output codebase.json009010# Analyze multiple repositories for comparison011for repo in "rust-lang/cargo" "golang/go" "nodejs/node"; do012 omnivore git https://github.com/$repo --output "${repo//\//-}.txt"013done
Configuration Examples
Basic Configuration File
Create ~/.config/omnivore/crawler.toml:
TOML001[crawler]002max_workers = 10003max_depth = 5004user_agent = "Omnivore/1.0 (+https://yoursite.com/bot)"005respect_robots_txt = true006timeout_ms = 30000007008[crawler.politeness]009default_delay_ms = 100010max_requests_per_second = 10.0011backoff_multiplier = 2.0012013[parser]014clean_text = true015extract_metadata = true016017[storage]018data_dir = "~/.local/share/omnivore"019cache_size_mb = 1024020compression = "zstd"
Domain-Specific Configuration
TOML001# Site-specific settings002[[crawler.site_configs]]003domain = "example.com"004delay_ms = 500005max_requests_per_second = 2.0006custom_headers = { "X-API-Key" = "your-key" }007008[[crawler.site_configs]]009domain = "news.ycombinator.com"010delay_ms = 1000011max_depth = 3
Monitoring and Statistics
View Crawl Statistics
BASH001# Current session stats002omnivore stats003004# Historical stats005omnivore stats --session crawl-20240809006007# Export stats to CSV008omnivore stats --export stats.csv
Real-time Monitoring
BASH001# Watch crawl progress002omnivore crawl https://example.com --watch
Tips for Success
Pro Tips
- ▪ Start small: Begin with low depth and workers, then scale up
- ▪ Respect robots.txt: Always enable robots.txt compliance
- ▪ Monitor resources: Watch CPU and memory usage during crawls
- ▪ Use delays: Be respectful with request timing
- ▪ Save configurations: Create reusable config files for common patterns
Ready to dive deeper? Check out the Configuration Guide to customize Omnivore for your specific needs.
Built with Rust. Developed by Pranav Karra