scrapling
БесплатноБез исполняемых скриптовНе проверенFetches web pages and extracts structured data from them with Python, from a single HTTP request to a full crawl, including pages rendered by JavaScript and…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Scrapling — Adaptive web scraping and crawling
Overview
Scrapling is a Python scraping framework with three layers: fetchers that download pages (plain HTTP or a real browser), a fast parser with CSS, XPath and text search, and a spider engine for concurrent crawls with pause and resume. Its parser can store the fingerprint of an element and find it again after the page structure changes.
Instructions
Installation
python -m venv .venv
source .venv/bin/activate
pip install "scrapling[fetchers]"
scrapling install
pip install scrapling alone installs only the parser; importing scrapling.fetchers or scrapling.spiders then raises ModuleNotFoundError. scrapling install downloads the browsers and their system dependencies (the dependency step uses sudo on Linux); add --force to reinstall.
| Extra | Adds |
|---|---|
fetchers |
HTTP and browser fetchers, spiders |
shell |
scrapling extract commands and the interactive shell |
ai |
MCP server (scrapling mcp) |
all |
Everything above |
A Docker image with all extras and browsers is published as pyd4vinci/scrapling and ghcr.io/d4vinci/scrapling:latest.
Choose a fetcher
| Class | Engine | Use for |
|---|---|---|
Fetcher |
HTTP with browser TLS impersonation | Static HTML and JSON APIs; fastest |
StealthyFetcher |
Patchright-patched Chromium with fingerprint spoofing | Content rendered by JavaScript, and sites that block automated browsers |
Start with Fetcher. Move to a browser only when the data is missing from the raw HTML. Each class has a session variant (FetcherSession, StealthySession) that keeps cookies and, for browsers, keeps the browser open between requests. RemoteSession attaches to a browser that is already running (see below). Since 0.5 there is no separate plain-Playwright fetcher: DynamicFetcher, DynamicSession and AsyncDynamicSession were removed and importing them raises ImportError; use StealthyFetcher, StealthySession and AsyncStealthySession.
HTTP requests
from scrapling.fetchers import Fetcher, FetcherSession
page = Fetcher.get("https://quotes.toscrape.com/", impersonate="chrome", timeout=30)
print(page.status) # 200
print(page.css(".quote .author::text").getall()[:3])
with FetcherSession(impersonate="chrome", retries=3) as session:
first = session.get("https://quotes.toscrape.com/page/1/")
second = session.get("https://quotes.toscrape.com/page/2/")
Fetcher also has post, put and delete. timeout is in seconds here and in milliseconds for the browser fetchers.
Select and navigate
from scrapling.fetchers import Fetcher
page = Fetcher.get("https://quotes.toscrape.com/")
quotes = page.css(".quote") # list of elements
quotes = page.xpath('//div[@class="quote"]')
quotes = page.find_all("div", class_="quote")
author = page.find_by_text("Albert Einstein", first_match=True)
first = quotes[0]
text = first.css(".text::text").get() # first match or None
tags = first.css(".tag::text").getall() # every match
href = page.css(".next a::attr(href)").get() # "/page/2/"
absolute = page.urljoin(href) # full URL
opening = first.css(".text::text").re_first(r"“(\w+ \w+)") # "The world"
similar = first.find_similar() # the other nine quote blocks
selector = first.generate_css_selector # property, not a method
markdown = page.markdown() # whole page as Markdown
css() and xpath() always return a list. Index it ([0]) or use .first before calling element methods such as get_all_text(). To parse HTML that is already on disk, use Selector from scrapling.parser.
JavaScript-rendered pages
from scrapling.fetchers import StealthyFetcher, StealthySession
def open_second_page(browser_page):
browser_page.click("li.next a") # Patchright page API (Playwright-compatible)
browser_page.wait_for_selector(".quote")
page = StealthyFetcher.fetch(
"https://quotes.toscrape.com/js/",
headless=True,
network_idle=True,
wait_selector=".quote",
timeout=45000,
page_action=open_second_page,
)
print(page.url, len(page.css(".quote")))
with StealthySession(headless=True, network_idle=True) as session:
for number in (1, 2, 3):
listing = session.fetch(f"https://quotes.toscrape.com/js/page/{number}/")
print(number, len(listing.css(".quote")))
Useful options: disable_resources=True (skip fonts, images, stylesheets), block_ads=True, proxy=, real_chrome=True (use the installed Chrome), wait= (extra milliseconds after load), record_requests=True on a session (then session.network.search(url_pattern=...) lists the XHR/fetch responses the page made; this replaces the removed capture_xhr).
StealthyFetcher.fetch() also takes `solve_cloudflare=
Установить scrapling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл scrapling?
Fetches web pages and extracts structured data from them with Python, from a single HTTP request to a full crawl, including pages rendered by JavaScript and selectors that keep working after a site redesign. Use when a user asks to scrape a website, build a crawler or spider, extract product or listing data, follow pagination, scrape a JavaScript-rendered page, save a page as Markdown, or mentions Scrapling, "scrape this URL", or "my scraper keeps breaking".
Как установить скилл scrapling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scrapling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic