web-scraping
БесплатноБез исполняемых скриптовНе проверенWeb scraping for RAG ingestion. Covers Firecrawl API, Crawl4AI (open source), trafilatura (main-content extraction), BeautifulSoup + readability-lxml, Scrapy…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Web Scraping for RAG
Tool Comparison
| Tool | Type | JS Rendering | Main-Content | Scale | Best For |
|---|---|---|---|---|---|
| Firecrawl | API (paid) | Yes | Excellent (LLM) | Medium | Quick RAG ingestion, markdown out |
| Crawl4AI | OSS library | Yes (Playwright) | Very good | Medium | Self-hosted, LLM-friendly |
| trafilatura | OSS library | No | Excellent | High | Article/news extraction |
| BeautifulSoup + readability-lxml | OSS | No | Good | High | Custom HTML parsing |
| Scrapy | OSS framework | No (+ splash) | Manual | Very high | Multi-million page crawls |
| Playwright | Browser automation | Yes | Manual | Low-medium | SPA / logged-in scraping |
Firecrawl API
import os
from firecrawl import FirecrawlApp
app = FirecrawlApp(api_key=os.environ["FIRECRAWL_API_KEY"])
# Single page -> markdown
result = app.scrape_url(
"https://docs.anthropic.com/claude/docs",
params={
"formats": ["markdown", "links", "html"],
"onlyMainContent": True,
"waitFor": 1500,
"timeout": 30000,
},
)
print(result["markdown"][:500])
# Full site crawl
job = app.crawl_url(
"https://docs.anthropic.com",
params={
"limit": 500,
"scrapeOptions": {"formats": ["markdown"], "onlyMainContent": True},
"excludePaths": ["/blog/*", "/legal/*"],
"maxDepth": 4,
},
wait_until_done=True,
)
for page in job["data"]:
save_chunk(page["metadata"]["sourceURL"], page["markdown"])
Crawl4AI — Open Source, LLM-Friendly
import asyncio
from crawl4ai import AsyncWebCrawler, CrawlerRunConfig, BrowserConfig
from crawl4ai.extraction_strategy import LLMExtractionStrategy
async def crawl():
browser = BrowserConfig(headless=True, viewport_width=1280)
run_cfg = CrawlerRunConfig(
word_count_threshold=50,
exclude_external_links=True,
remove_overlay_elements=True,
wait_for="css:article",
cache_mode="bypass",
)
async with AsyncWebCrawler(config=browser) as crawler:
result = await crawler.arun(
url="https://example.com/article",
config=run_cfg,
)
return result.markdown.fit_markdown, result.links["internal"]
md, links = asyncio.run(crawl())
trafilatura — Main-Content Extraction
import trafilatura
from trafilatura.settings import use_config
cfg = use_config()
cfg.set("DEFAULT", "EXTRACTION_TIMEOUT", "30")
downloaded = trafilatura.fetch_url("https://news.ycombinator.com/item?id=1")
result = trafilatura.extract(
downloaded,
output_format="markdown",
include_tables=True,
include_links=True,
include_comments=False,
with_metadata=True,
favor_precision=True,
config=cfg,
)
print(result)
# Sitemap-driven ingestion
from trafilatura.sitemaps import sitemap_search
urls = sitemap_search("https://example.com")
for url in urls[:1000]:
html = trafilatura.fetch_url(url)
text = trafilatura.extract(html, output_format="markdown")
if text:
save_chunk(url, text)
BeautifulSoup + readability-lxml
import requests
from bs4 import BeautifulSoup
from readability import Document # readability-lxml
html = requests.get("https://example.com/post", timeout=15).text
doc = Document(html)
title = doc.title()
cleaned_html = doc.summary(html_partial=True)
soup = BeautifulSoup(cleaned_html, "lxml")
for tag in soup(["script", "style", "nav", "footer", "aside"]):
tag.decompose()
text = soup.get_text("\n", strip=True)
Scrapy — Large-Scale Crawl
# spider.py
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
class DocsSpider(CrawlSpider):
name = "docs"
allowed_domains = ["example.com"]
start_urls = ["https://example.com/sitemap.xml"]
custom_settings = {
"ROBOTSTXT_OBEY": True,
"CONCURRENT_REQUESTS": 16,
"DOWNLOAD_DELAY": 0.5,
"AUTOTHROTTLE_ENABLED": True,
"AUTOTHROTTLE_TARGET_CONCURRENCY": 4.0,
"USER_AGENT": "RAGBot/1.0 (+https://myorg.com/bot)",
"HTTPCACHE_ENABLED": True,
"DEPTH_LIMIT": 5,
}
rules = (
Rule(LinkExtractor(allow=r"/docs/"), callback="parse_page", follow=True),
)
def parse_page(self, response):
yield {
"url": response.url,
"title": response.css("h1::text").get(),
"text": " ".join(response.css("article ::text").getall()),
}
Run: scrapy runspider spider.py -O out.jsonl.
Playwright — JS-Rendered Pages
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
ctx = browser.new_context(
user_agent="RAGBot/1.0",
viewport={"width": 1280, "height": 900},
)
page = ctx.new_page()
page.goto("https://spa.example.com", wait_until="networkidle")
page.wait_for_selector("article")
Установить web-scraping в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл web-scraping?
Web scraping for RAG ingestion. Covers Firecrawl API, Crawl4AI (open source), trafilatura (main-content extraction), BeautifulSoup + readability-lxml, Scrapy for large crawls, Playwright for JS-rendered pages, sitemap.xml discovery, robots.txt, polite crawling, anti-bot, and deduplication. USE WHEN: user mentions "web scraping", "crawl website", "Firecrawl", "Crawl4AI", "trafilatura", "readability", "BeautifulSoup", "Scrapy", "Playwright scrape", "sitemap", "robots.txt", "crawl for RAG", "extract article" DO NOT USE FOR: parsing already-downloaded HTML files for layout - use `unstructured-io`; PDF downloads from the web - use `pdf-extraction`; office docs behind login - use `office-docs`; structured markdown vaults - use `markdown-structured`
Как установить скилл web-scraping?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл web-scraping запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic