scraperapi-scraper-builder skill
ScraperAPI를 사용하여 오류 처리 및 페이지네이션 기능이 내장된 완성도 높은 Python 또는 Node.js 웹 스크래핑 스크립트를 생성합니다.
- GitHub 스타
- 10
- 파일
- 2
- 마지막 커밋
- 2026년 8월 7일
- 라이선스
- MIT
- 허용된 도구
- —
scraperapi-scraper-builder skill은 무엇을 하나요?
scraperapi-scraper-builder은(는) agent skill입니다. ScraperAPI를 사용하여 오류 처리 및 페이지네이션 기능이 내장된 완성도 높은 Python 또는 Node.js 웹 스크래핑 스크립트를 생성합니다.
skill의 SKILL.md에서 생성된 요약입니다.
scraperapi-scraper-builder skill 정보
데이터 추출 자동화가 필요한 개발자는 이 SKILL을 사용하여 Python 또는 Node.js 기반의 프로덕션급 웹 스크래핑 스크립트를 생성할 수 있습니다. 이 도구는 먼저 대상 웹사이트의 동작 방식을 관찰하기 위해 사이트 정찰을 수행하여 전체 개발 라이프사이클을 자동화합니다. ScraperAPI를 통해 샘플 페이지를 가져옴으로써, 해당 사이트가 Cloudflare와 같은 안티봇 보호 기능을 사용하는지 또는 콘텐츠 표시를 위해 JavaScript 렌더링이 필요한지 식별합니다.
사이트 프로필이 구축되면, 프리미엄 또는 울트라 프리미엄 설정과 같은 프록시 티어에 대한 아키텍처 결정을 내리고 최적의 페이지네이션 전략을 결정합니다. 오류 처리, 지수 백오프(exponential backoff) 재시도 로직, 예산 초과 방지를 위한 크레딧 추정 기능이 포함된 실행 가능한 완성된 스크립트를 생성합니다. 결과 코드는 식별된 CSS 선택자 또는 내부 API 엔드포인트를 사용하여 특정 대상에 맞춤화되므로 신뢰할 수 있는 데이터 추출을 보장합니다.
agent가 수행할 수 있는 작업
- 1맞춤형 이커머스 스크래퍼 구축특정 온라인 소매업체에서 제품 상세 정보와 가격을 추출하는 Python 스크립트를 생성합니다.
- 2복잡한 JavaScript 렌더링 처리데이터 컨테이너를 로드하기 위해 JavaScript가 필요한 SPA(Single-Page Application)용 스크래퍼를 제작합니다.
- 3대규모 데이터 수집 자동화수백 개의 URL을 효율적으로 스크래핑하기 위한 비동기 배치 작업을 구현합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
scraperapi-scraper-builder skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.Claude Code에 scraperapi-scraper-builder skill 설치
~/.claude/skills/scraperapi-scraper-builder/SKILL.md
$ npx degit scraperapi/scraperapi-skills/skills/scraperapi-scraper-builder ~/.claude/skills/scraperapi-scraper-builderClaude Code (project)에 scraperapi-scraper-builder skill 설치
.claude/skills/scraperapi-scraper-builder/SKILL.md
$ npx degit scraperapi/scraperapi-skills/skills/scraperapi-scraper-builder .claude/skills/scraperapi-scraper-builderCodex에 scraperapi-scraper-builder skill 설치
~/.agents/skills/scraperapi-scraper-builder/SKILL.md
$ npx degit scraperapi/scraperapi-skills/skills/scraperapi-scraper-builder ~/.agents/skills/scraperapi-scraper-builderGemini CLI에 scraperapi-scraper-builder skill 설치
~/.gemini/skills/scraperapi-scraper-builder/SKILL.md
$ npx degit scraperapi/scraperapi-skills/skills/scraperapi-scraper-builder ~/.gemini/skills/scraperapi-scraper-builderClaude.ai에 scraperapi-scraper-builder skill 설치
npx degit scraperapi/scraperapi-skills/skills/scraperapi-scraper-builder scraperapi-scraper-builder && zip -r scraperapi-scraper-builder.zip scraperapi-scraper-builder # claude.ai → Customize → Skills → + → Create skill → Upload a skill → scraperapi-scraper-builder.zip
SKILL.md
GitHub에서 보기ScraperAPI Scraper Builder
Build production-quality scrapers using ScraperAPI. Work through four phases: gather requirements, probe the target site, make architecture decisions, then generate a complete runnable script.
Phase 1 — Gather Requirements
Before writing code, collect the following. Pull from the user's prompt; ask only what is missing.
| Info | Default if not specified |
|---|---|
| Target URL or website | Required — ask if missing |
| Data fields to extract | Ask if vague ("product info" → which fields exactly?) |
| Volume | Infer: single URL / paginated / bulk list of URLs |
| Language | Ask if not clear from context; Python is a reasonable default |
| Output format | stdout JSON |
| Geo-targeting needed? | Infer from site type; confirm for e-commerce pricing |
Phase 2 — Site Reconnaissance
Before making any architecture decisions, fetch 1–2 sample pages from the target site using ScraperAPI to observe actual behavior. This replaces guesswork with evidence and costs at most 2 credits.
What to fetch
Fetch at most two pages:
- A listing or category page (the main target) — e.g., a product grid, search results, or article index
- A detail page (only if the user needs data from individual items) — e.g., a single product, article, or profile
Always start with a standard request (no render, no premium) — the cheapest probe:
GET https://api.scraperapi.com/?api_key=<SCRAPERAPI_API_KEY>&url=<target_url>
What to observe
1. Response status
| Status | Meaning |
|---|---|
| 200 | Proceed to content analysis |
403 + body has "Just a moment", cf-ray, or "Cloudflare" |
Cloudflare detected |
| 403 + body has "DataDome", "PerimeterX", or "Akamai" | Bot manager detected |
| 403 (generic) | Anti-bot protection present; premium proxies likely needed |
| 429 | Rate limited; note for architecture phase |
2. Content completeness (for 200 responses)
Signals that render=true will be needed:
- Empty SPA containers:
<div id="root"></div>,<div id="app"></div>,<div id="__next"></div>with no children - Framework markers in
<script>tags:_next,__nuxt__,react,vue,angular - Response is mostly
<script>and<div>tags with little visible text - Target data fields (from Phase 1) are absent from the HTML
If the target data is visibly present in the raw HTML → standard rendering is sufficient, do not enable render.
3. Pagination structure
Look for the site's pagination scheme in <a> hrefs and link tags:
<a rel="next">or<link rel="next">→ follow-the-next-link pattern?page=N,?p=N,/page/N/in hrefs → page-number pagination?start=Nor?offset=N→ offset-based pagination- No pagination links +
data-infinite-scrollor "Load more" button → JS-driven infinite scroll (requiresrender=true)
Note the exact URL pattern — this feeds directly into the pagination loop in Phase 4.
4. Data structure (when target fields are visible)
- Identify the repeating container element (e.g.,
<li class="product-item">,<div class="listing-card">) - Note CSS selectors for each target field from Phase 1
- Check for embedded structured data:
<script type="application/ld+json">(JSON-LD) ordata-*attributes — these are often cleaner to parse than raw HTML
5. Internal API endpoints (bonus)
Scan inline <script> blocks for fetch( or axios.get( calls pointing to internal paths (e.g., /api/products, /_next/data/). If found, scraping that JSON endpoint is usually simpler and more stable than parsing HTML.
Site Profile — output of this phase
Summarize findings as a table before proceeding. Every row maps to a specific decision in Phase 3.
| Signal | Observed |
|-------------------------|---------------------------------------|
| HTTP status (standard) | 200 / 403 / ... |
| Anti-bot protection | None / Cloudflare / DataDome / ... |
| JS rendering needed | Yes / No / Uncertain |
| Pagination pattern | ?page=N / rel=next / load-more / ... |
| Target data visible | Yes / No (skeleton HTML) |
| Data container selector | e.g. div.product-card |
| Structured data (LD+J) | Present / Not found |
| Internal API detected | Yes (<path>) / No |
Phase 3 — Architecture Decisions
Use the Site Profile from Phase 2 as primary evidence for each decision. Work through all six decisions in order, citing specific observations from the profile. Summarize all decisions as a table (see end of this section) before writing any code.
Decision 1 — Is there a Structured Data endpoint?
Check if the target site is one of the supported verticals. If yes, use it — structured endpoints return clean JSON with no HTML parsing, and they handle rendering and anti-bot automatically. Skip Decisions 2 and 3.
Supported verticals (verify against docs):
- Amazon:
product,search,offers,reviews - Google:
search,news,jobs,shopping,maps - Walmart:
product,search,category - eBay:
product,search - Redfin:
listing,search - Indeed:
jobs,job - LinkedIn:
profile,jobs(availability may vary)
Endpoint pattern: GET https://api.scraperapi.com/structured/<site>/<type>?api_key=...&<required_param>=...
Decision 2 — Does the page require JavaScript rendering?
Enable render=true only when the Site Profile confirms that target data was absent in the standard response. Cost: ~10 credits/req.
- Site Profile says "Target data visible: No" or "JS rendering needed: Yes" → enable
render=true - Site Profile says "Target data visible: Yes" → do not enable
render=true - Site Profile says "Uncertain" → fetch one more sample with
render=trueand compare
Do not enable render=true speculatively — the Phase 2 probe is the evidence.
Decision 3 — Does the site have anti-bot protection?
Use the Site Profile's "Anti-bot protection" row as the starting point. Escalate gradually — never start at the highest tier.
- Site Profile says "None" → start with standard
- Site Profile says "Cloudflare" or any bot manager → start with
premium=true(~10 credits) premium=truestill returns 403 → escalate toultra_premium=true(~30 credits)
ultra_premium=true and premium=true are mutually exclusive — never set both.
Decision 4 — What is the volume?
| Volume | Approach |
|---|---|
| 1–10 URLs | Sync loop, no special handling |
| 10–100 URLs | Sync with 1 req/sec rate limiting |
| >100 URLs | Async Jobs API (POST https://async.scraperapi.com/batchjobs) |
For async batches, the script submits all URLs, then polls until all jobs complete. See references/code-templates.md for the async pattern.
Decision 5 — Is session state needed?
Add session_number=<int> when:
- The scraper must follow a login flow
- Multi-step checkout or auth-gated pages
- Pagination state must be maintained across requests
Pick any integer as the session ID. Requests with the same session_number are routed through the same proxy IP.
Decision 6 — Is geo-targeting needed?
Add country_code (ISO-3166, e.g., us, gb, de) when:
- Scraping prices that vary by region
- Target site redirects or blocks based on geography
- SERP results should be localized
Architecture summary table
Before generating code, print this table:
| Parameter | Value | Reason |
|----------------|------------|-----------------------------------|
| url | ... | target |
| render | true/false | (why) |
| premium | true/false | (why) |
| ultra_premium | true/false | (why) |
| country_code | us / – | (why) |
| session_number | N / – | (why) |
| volume mode | sync/async | (why) |
Phase 4 — Generate Code
Ask for language if not already known (default: Python). Generate a complete, runnable script — not pseudocode or snippets. See references/code-templates.md for the base templates to adapt.
Use the Site Profile from Phase 2 to pre-fill the parsing logic: if a data container selector was identified (e.g., div.product-card), write it directly into the extract() function rather than leaving a TODO. If JSON-LD was found, parse <script type="application/ld+json"> instead of navigating the HTML tree. If an internal API path was found, target that endpoint instead of the page HTML.
Python script structure
argparseCLI with--url,--pages,--output,--max-credits, plus flags for all ScraperAPI params decided in Phase 3- API key from
os.environ["SCRAPERAPI_API_KEY"]— never hardcoded scrape()function with exponential backoff retry (5 attempts)- Status code handling per the error table below
- Credit estimate printed to stderr before any requests
- Pagination loop using the pattern identified in the Site Profile, with 1 req/sec rate limit for sync mode
extract()function pre-filled with selectors from the Site Profile (or a TODO if none were identified)- Output as JSON to stdout or
--outputfile
Node.js script structure
Same flags and behavior as above. Use node-fetch@2 + commander. Match the user's existing module format (ESM vs. CommonJS) if known, otherwise default to CommonJS.
Always include at the top of the generated script
# Requirements: pip install requests (Python)
# Requirements: npm install node-fetch@2 commander (Node.js)
# Usage: SCRAPERAPI_API_KEY=your_key python scraper.py --url "https://example.com" --pages 5
Credit Cost Reference
| Configuration | Credits per request |
|---|---|
| Standard | 1 |
render=true |
~10 |
premium=true |
~10 |
ultra_premium=true |
~30 |
| Structured endpoint | 1–10 (varies by vertical) |
Print a cost estimate before executing: # Estimated: 50 pages × 10 credits = ~500 credits
The generated script must include a --max-credits flag that aborts if the estimate exceeds the budget.
Error Handling
| Status | Action |
|---|---|
| 200 | Parse and return |
| 401 | Abort — invalid API key, do not retry |
| 403 | Retry with premium=true; if still blocked, try ultra_premium=true |
| 404 | Skip this URL — page does not exist |
| 429 | Exponential backoff and retry; switch to async for large batches |
| 500/503 | Exponential backoff, max 5 attempts |
Validation Checklist
Before presenting the script:
- Site Profile was produced in Phase 2 and each architecture decision cites it
- API key is read from
$SCRAPERAPI_API_KEYenv var — not hardcoded - Retry logic covers 429, 500, 503 with exponential backoff
-
--max-creditsguard is present and enforced before the first request - Credit estimate is printed to stderr before any requests are made
- If using a structured endpoint: vertical name matches the cheatsheet exactly
- If async: script includes polling loop or webhook handling, not just job submission
-
ultra_premiumandpremiumare not both set - Setup instructions comment is at the top of the script
- A TODO comment marks where the user should add their parsing logic
References
- references/code-templates.md — Python and Node.js base templates (sync + async)
- ScraperAPI docs
- Structured Data endpoints
- Async API
- Parameter reference
- Dashboard
이 스킬의 파일
2scraperapi-scraper-builder skill 질문
Claude Code에 scraperapi-scraper-builder skill을 어떻게 설치하나요?
npx degit scraperapi/scraperapi-skills/skills/scraperapi-scraper-builder ~/.claude/skills/scraperapi-scraper-builder를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
scraperapi-scraper-builder skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
생성된 스크래퍼에서 어떤 프로그래밍 언어를 사용할 수 있나요?
Python 또는 Node.js로 실행 가능한 완성된 스크립트를 생성할 수 있습니다.
JavaScript 렌더링이 필요한지 여부를 어떻게 판단하나요?
샘플 페이지를 가져와 SPA 컨테이너가 비어 있는지 또는 React나 Vue와 같은 프레임워크 마커가 있는지 확인하는 사이트 정찰을 수행합니다.