返回 Skill 列表
extension
分类: 其它无需 API Key

Crawlee Web Scraper

基于 Crawlee 库的健壮网页抓取工具,具备机器人检测规避能力。适用于 web_fetch 因速率限制或反爬虫被阻止的情况。支持单个 URL...

person作者: bryantegomohhubclawhub

crawlee-web-scraper

Drop-in replacement for web_fetch when sites block automated requests. Crawlee handles session management, retry logic, and bot-detection evasion automatically.

Scripts

  • crawlee_fetch.py — main scraper; accepts a single URL or a file of URLs; returns JSON
  • crawlee_http.py — library helper; tries requests first, falls back to Crawlee on 403/429/503

Usage

# Single URL, return HTML preview
python3 scripts/crawlee_fetch.py --url "https://example.com"

# Single URL, extract text (strips HTML tags)
python3 scripts/crawlee_fetch.py --url "https://example.com" --extract-text

# Bulk scrape from file
python3 scripts/crawlee_fetch.py --urls-file urls.txt --output results.json

Library usage

from crawlee_http import fetch_with_fallback

resp = fetch_with_fallback("https://example.com")
print(resp.status_code, resp.text[:500])

Output

JSON array with one object per URL:

[
  {
    "url": "https://example.com",
    "status": 200,
    "fetched_at": "2026-01-01T00:00:00Z",
    "length": 12345,
    "text": "Page content..."
  }
]

Installation

pip install crawlee requests

When to use

  • web_fetch returns 403 / 429 / empty
  • Bulk scraping 10+ URLs
  • Sites using Cloudflare or similar bot protection