Web Fetch Strategy

2026-08-30 浏览 (1)

Web Fetch Strategy

Common web fetching strategy for anti-crawler handling.

Site Classification

TypeExamplesCharacteristics
Anti-crawlerReddit, Twitter/X, LinkedInNeed login or browser fingerprint
Regularblog.rust-lang.org, docs.rsNo anti-crawler, direct fetch

Fetch Priority

Anti-crawler sites: Local Chrome → crawl4ai MCP → give up and mark
Regular sites: WebFetch → crawl4ai MCP

Tools

1. Local Chrome (for anti-crawler)

User's real browser with login and normal fingerprint.

macOS:

# Open URL
osascript -e 'tell application "Google Chrome" to open location "URL"'

# Get page HTML
osascript -e 'tell application "Google Chrome" to execute front window'\''s active tab javascript "document.documentElement.outerHTML"'

2. crawl4ai MCP (fallback)

Strong anti-crawler bypass, needs Docker.

mcp__crawl4ai__scrape(url: "URL")

3. WebFetch (regular sites)

Built-in tool, simple and fast, no anti-crawler capability.

Site Routing

DomainToolReason
reddit.comLocal ChromeStrict anti-crawler
twitter.com / x.comLocal ChromeNeeds login
linkedin.comLocal ChromeStrict anti-crawler
*.rust-lang.orgWebFetchNo anti-crawler
docs.rsWebFetchNo anti-crawler
crates.ioWebFetchNo anti-crawler
this-week-in-rust.orgWebFetchNo anti-crawler
rustfoundation.orgWebFetchNo anti-crawler
github.comWebFetchLight rate limit

Failure Handling

  1. Local Chrome fails → try crawl4ai
  2. crawl4ai fails → try WebFetch
  3. All fail → mark "Fetch failed: {reason}"

Validation

After fetch, check:

  • Content is not empty
  • Not an error page (403, 429, "blocked")
  • Contains expected data

你可能感兴趣的文章

Agent Cache System

Rust Skills Tests

Agent Integration Test Scenarios

Domain Skills Test Scenarios

Rust-Router Test Scenarios

Ownership (m01) Test Scenarios

Unsafe-Checker Test Scenarios

Layer 2 Skills Test Scenarios

Pressure Scenario: When to Use unwrap()

Pressure Scenario: Send/Sync Trait Bounds

  • 所属分类: AI
  • 本文标签: rust
  • 版权声明: 本文链接 https://seaxiang.com/blog/wVODWfMq