by yfe404
Intelligent web scraping Claude Code skill with automatic strategy selection and TypeScript-first Apify Actor development
# Add to your Claude Code skills
git clone https://github.com/yfe404/web-scraperGuides for using api integration skills like web-scraper.
web-scraper is an open-source api integration skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by yfe404. Intelligent web scraping Claude Code skill with automatic strategy selection and TypeScript-first Apify Actor development. It has 114 GitHub stars.
web-scraper's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/yfe404/web-scraper" and add it to your Claude Code skills directory (see the Installation section above). web-scraper ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
web-scraper is primarily written in TypeScript. It is open-source under yfe404 on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other API Integration skills you can browse and compare side by side. Open the API Integration category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh web-scraper against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Activate automatically when user requests:
strategies/anti-blocking.md)apify/ subdirectory)Determine reconnaissance depth from user request:
| User Says | Mode | Phases Run |
|---|---|---|
| "quick recon", "just check", "what framework" | Quick | Phase 0 only |
| "scrape X", "extract data from X" (default) | Standard | Phases 0-3 + 5, Phase 4 only if protection signals detected |
| "full recon", "deep scan", "production scraping" | Full | All phases (0-5) including protection testing |
Default is Standard mode. Escalate to Full if protection signals appear during any phase.
This skill uses an adaptive phased workflow with quality gates. Each gate asks "Do I have enough?" — continue only when the answer is no.
See: strategies/framework-signatures.md for framework detection tables referenced throughout.
Gather maximum intelligence with minimum cost — a single HTTP request.
Step 0a: Fetch raw HTML and headers
curl -s -D- -L "https://target.com/page" -o response.html
Step 0b: Check response headers
strategies/framework-signatures.md → Response Header Signatures tableServer, X-Powered-By, X-Shopify-Stage, Set-Cookie (protection markers)Step 0c: Check Known Major Sites table
strategies/framework-signatures.md → Known Major SitesStep 0d: Detect framework from HTML
strategies/framework-signatures.md → HTML Signatures table__NEXT_DATA__, __NUXT__, ld+json, /wp-content/, data-reactrootStep 0e: Search for target data points
curl -s https://[site]/robots.txt | grep -i SitemapStep 0f: Note protection signals
cf-ray headerSee: strategies/cheerio-vs-browser-test.md for the Cheerio viability assessment
QUALITY GATE A: All target data points found in raw HTML + no protection signals? → YES: Skip to Phase 3 (Validate Findings). No browser needed. → NO: Continue to Phase 1.
Launch browser only for data points missing from raw HTML or when JavaScript rendering is required.
Step 1a: Initialize browser session
proxy_start() → Start traffic interception proxyinterceptor_chrome_launch(url, stealthMode: true) → Launch Chrome with anti-detectioninterceptor_chrome_devtools_attach(target_id) → Attach DevTools bridgeinterceptor_chrome_devtools_screenshot() → Capture visual stateStep 1b: Capture traffic and rendered DOM
proxy_list_traffic() → Review all traffic from page loadproxy_search_traffic(query: "application/json") → Find JSON responsesinterceptor_chrome_devtools_list_network(resource_types: ["xhr", "fetch"]) → XHR/fetch callsinterceptor_chrome_devtools_snapshot() → Accessibility tree (rendered DOM)Step 1c: Search rendered DOM for missing data points
strategies/framework-signatures.md → Framework → Search Strategy tableStep 1d: Inspect discovered endpoints
proxy_get_exchange(exchange_id) → Full request/response for promising endpointsQUALITY GATE B: All target data points now covered (raw HTML + rendered DOM + traffic)? → YES: Skip to Phase 3 (Validate Findings). No deep scan needed. → NO: Continue to Phase 2 for missing data points only.
Targeted investigation for data points not yet found. Only search for what's missing.
Step 2a: Test interactions for missing data
proxy_clear_traffic() before each action → Isolate API callshumanizer_click(target_id, selector) → Trigger dynamic content loadshumanizer_scroll(target_id, direction, amount) → Trigger lazy loading / infinite scrollhumanizer_idle(target_id, duration_ms) → Wait for delayed contentproxy_list_traffic() → Check for new API callsStep 2b: Sniff APIs (framework-aware)
proxy_list_traffic(url_filter: "/_next/data/")proxy_list_traffic(url_filter: "/wp-json/")proxy_search_traffic(query: "graphql")proxy_list_traffic(url_filter: "/api/") + proxy_search_traffic(query: "application/json")Step 2c: Test pagination and filtering
proxy_clear_traffic() → click next page → proxy_list_traffic(url_filter: "page=")QUALITY GATE C: Enough data points covered for a useful report? → YES: Go to Phase 3. → NO: Document gaps, go to Phase 3 anyway (report will note missing data in self-critique).
Every claimed extraction method must be verified. A data point is not "found" until the extraction path is specified and tested.
See: strategies/cheerio-vs-browser-test.md for validation methodology
Step 3a: Validate CSS selectors
Step 3b: Validate JSON paths
__NEXT_DATA__, API response): confirm the path resolvesStep 3c: Validate API endpoints
proxy_get_exchange)Step 3d: Downgrade or re-investigate failures
See: strategies/proxy-escalation.md for complete skip/run decision logic
Skip Phase 4 when ALL true:
Run Phase 4 when ANY true:
If running:
Step 4a: Test raw HTTP access
curl -s -o /dev/null -w "%{http_code}" "https://target.com/page"
Step 4b: Test with stealth browser (if needed)
interceptor_chrome_devtools_list_cookies(domain_filter: "cloudflare") → Protection cookiesinterceptor_chrome_devtools_list_storage_keys(storage_type: "local") → Fingerprint markersproxy_get_tls_fingerprints() → TLS fingerprint analysisStep 4c: Test with upstream proxy (if needed)
proxy_set_upstream("http://user:pass@proxy-provider:port")Step 4d: Document protection profile
Generate the intelligence report, then critically review it for gaps.
See: reference/report-schema.md for complete report format
Step 5a: Generate report
reference/report-schema.md schema (Sections 1-6)Validated? status for every strategy (YES / PARTIAL / NO)Step 5b: Self-critique
reference/report-schema.md:
Step 5c: Fix gaps with targeted re-investigation
Step 5d: Record session (if browser was used)
proxy_session_start(name) → proxy_session_stop(session_id) → proxy_export_har(session_id, path)strategies/session-workflows.mdAfter reconnaissance report is accepted, implement scraper iteratively.
Core Pattern:
See: workflows/implementation.md for complete implementation patterns and code examples
Convert scraper to production-ready Apify Actor.
Activation triggers: "Make this an Apify Actor", "Productionize this", "Deploy to Apify"
Core Pattern:
apify create command (CRITICAL)Note: During development, proxy-mcp provides reconnaissance and traffic analysis. For production Actors, use Crawlee crawlers (CheerioCrawler/PlaywrightCrawler) on Apify infrastructure.
See: workflows/productionization.md for complete workflow and apify/ for Actor development guides
| Task | Pattern/Command | Documentation |
|---|---|---|
| Reconnaissance | Adaptive Phases 0-5 | workflows/reconnaissance.md |
| Framework detection | Header + HTML signature matching | strategies/framework-signatures.md |
| Cheerio vs Browser | Three-way test + early exit | strategies/cheerio-vs-browser-test.md |
| Traffic analysis | proxy_list_traffic() + proxy_get_exchange() |
strategies/traffic-interception.md |
| Protection testing | Conditional escalation | strategies/proxy-escalation.md |
| Report format | Sections 1-7 with self-critique | reference/report-schema.md |
| Find sitemaps | RobotsFile.find(url) |
strategies/sitemap-discovery.md |
| Filter sitemap URLs | RequestList + regex |
reference/regex-patterns.md |
| Discover APIs | Traffic capture (automatic) | strategies/api-discovery.md |
| DOM scraping | DevTools bridge + humanizer | strategies/dom-scraping.md |
| HTTP scraping | CheerioCrawler |
strategies/cheerio-scraping.md |
| Hybrid approach | Sitemap + API | strategies/hybrid-approaches.md |
| Handle blocking | Stealth mode + upstream proxies | strategies/anti-blocking.md |
| Session recording | proxy_session_start() / proxy_export_har() |
strategies/session-workflows.md |
| Proxy-MCP tools | Complete reference | reference/proxy-tool-reference.md |
| Fingerprint configs | Stealth + TLS presets | reference/fingerprint-patterns.md |
| Create Apify Actor | apify create |
apify/cli-workflow.md |
| Template selection | Cheerio vs Playwright | workflows/productionization.md |
| Input schema | .actor/input_schema.json |
apify/input-schemas.md |
| Deploy actor | apify push |
apify/deployment.md |
import { RobotsFile, CheerioCrawler, Dataset } from 'crawlee';
// Auto-discover and parse sitemaps
const robots = await RobotsFile.find('https://example.com');
const urls = await robots.parseUrlsFromSitemaps();
const crawler = new CheerioCrawler({
async requestHandler({ $, request }) {
const data = {
title: $('h1').text().trim(),
// ... extract data
};
await Dataset.pushData(data);
},
});
await crawler.addRequests(urls);
await crawler.run();
See examples/sitemap-basic.js for complete example.
import { gotScraping } from 'got-scraping';
const productIds = [123, 456, 789];
for (const id of productIds) {
const response = await gotScraping({
url: `https://api.example.com/products/${id}`,
responseType: 'json',
});
console.log(response.body);
}
See examples/api-scraper.js for complete example.
// Get URLs from sitemap
const robots = await RobotsFile.find('https://shop.com');
const urls = await robots.parseUrlsFromSitemaps();
// Extract IDs from URLs
const productIds = urls
.map(url => url.match(/\/products\/(\d+)/)?.[1])
.filter(Boolean);
// Fetch data via API
for (const id of productIds) {
const data = await gotScraping({
url: `https://api.shop.com/v1/products/${id}`,
responseType: 'json',
});
// Process data
}
See examples/hybrid-sitemap-api.js for complete example.
This skill uses progressive disclosure - detailed information is organized in subdirectories and loaded only when needed.
For: Step-by-step workflow guides for each phase
workflows/reconnaissance.md - Phase 1 interactive reconnaissance (CRITICAL)workflows/implementation.md - Phase 4 iterative implementation patternsworkflows/productionization.md - Phase 5 Apify Actor creation workflowFor: Detailed guides on specific scraping approaches
strategies/framework-signatures.md - Framework detection lookup tables (Phase 0/1)strategies/cheerio-vs-browser-test.md - Cheerio vs Browser decision test with early exitstrategies/proxy-escalation.md - Protection testing skip/run conditions (Phase 4)strategies/traffic-interception.md - Traffic interception via MITM proxystrategies/sitemap-discovery.md - Complete sitemap guide (4 patterns)strategies/api-discovery.md - Finding and using APIsstrategies/dom-scraping.md - DOM scraping via DevTools bridgestrategies/cheerio-scraping.md - HTTP-only scrapingstrategies/hybrid-approaches.md - Combining strategiesstrategies/anti-blocking.md - Multi-layer anti-detection (stealth, humanizer, proxies, TLS)strategies/session-workflows.md - Session recording, HAR export, replayFor: Working code to reference or execute
JavaScript Learning Examples (Simple standalone scripts):
examples/sitemap-basic.js - Simple sitemap scraperexamples/api-scraper.js - Pure API approachexamples/traffic-interception-basic.js - Proxy-based reconnaissanceexamples/hybrid-sitemap-api.js - Combined approachexamples/iterative-fallback.js - Try traffic interception→sitemap→API→DOM scrapingTypeScript Production Examples (Complete Actors):
apify/examples/basic-scraper/ - Sitemap + Playwrightapify/examples/anti-blocking/ - Fingerprinting + proxiesapify/examples/hybrid-api/ - Sitemap + API (optimal)For: Quick patterns and troubleshooting
reference/report-schema.md - Intelligence report format (Sections 1-7 + self-critique)reference/proxy-tool-reference.md - Proxy-MCP tool reference (all 80+ tools)reference/regex-patterns.md - Common URL regex patternsreference/fingerprint-patterns.md - Stealth mode + TLS fingerprint presetsreference/anti-patterns.md - What NOT to doFor: Creating production Apify Actors
apify/README.md - When and how to use Apifyapify/typescript-first.md - Why TypeScript for actorsapify/cli-workflow.md - apify create workflow (CRITICAL)apify/initialization.md - Complete setup guideapify/input-schemas.md - Input validation patternsapify/configuration.md - actor.json setupapify/deployment.md - Testing and deploymentapify/templates/ - TypeScript boilerplateNote: Each file is self-contained and can be read independently. Claude will navigate to specific files as needed.
Start cheap (curl), escalate only when needed:
Use framework detection to focus searches:
strategies/framework-signatures.md before scanning__NEXT_DATA__ on Amazon)Every claimed extraction method must be tested:
Build incrementally:
When productionizing:
apify create (never manual setup)Remember: Traffic interception first, sitemaps second, APIs third, DOM scraping last!
For detailed guidance on any topic, navigate to the relevant subdirectory file listed above.
Intelligent web scraping with automatic strategy selection and TypeScript-first Apify Actor development.
This skill provides:
Add this skill to Claude Code by placing this directory in the skills folder.
User: "Scrape https://example.com"
Claude will automatically:
1. Phase 0: curl raw HTML — detect framework, search for data points, check sitemaps
2. QUALITY GATE: All data in HTML? → Skip browser, go to validation
3. Phase 1: Launch stealth browser (only if needed) — capture traffic, rendered DOM
4. Phase 2: Deep scan (only for missing data) — test interactions, sniff APIs
5. Phase 3: Validate every finding — test selectors, replay APIs, confirm paths
6. Phase 4: Protection testing (only if signals detected or user requested)
7. Phase 5: Generate intelligence report with self-critique
8. Implement recommended approach iteratively
9. Test with small batch, then scale
User: "Make this an Apify Actor"
Claude will:
1. Recommend TypeScript (strongly)
2. Guide through `apify create` command
3. Help choose appropriate template (Cheerio vs Playwright)
4. Port scraping logic to Actor format
5. Configure input schema
6. Test and deploy
web-scraping/
├── SKILL.md # Main entry point (proactive workflow)
├── workflows/ # Implementation patterns
│ ├── reconnaissance.md # Phase 1 interactive reconnaissance (CRITICAL)
│ ├── implementation.md # Phase 4 iterative implementation
│ └── productionization.md # Phase 5 Actor creation
├── strategies/ # Deep-dive guides
│ ├── framework-signatures.md # Framework detection lookup tables
│ ├── cheerio-vs-browser-test.md # Cheerio vs Browser decision + early exit
│ ├── proxy-escalation.md # Protection testing skip/run conditions
│ ├── traffic-interception.md # MITM proxy traffic capture
│ ├── sitemap-discovery.md # 60x faster URL discovery
│ ├── api-discovery.md # 10-100x faster than scraping
│ ├── dom-scraping.md # DevTools bridge + humanizer
│ ├── cheerio-scraping.md # HTTP-only (5x faster)
│ ├── hybrid-approaches.md # Combining strategies
│ ├── anti-blocking.md # Multi-layer anti-detection
│ └── session-workflows.md # Session recording, HAR, replay
├── examples/ # Runnable code
│ ├── traffic-interception-basic.js
│ ├── sitemap-basic.js
│ ├── api-scraper.js
│ ├── hybrid-sitemap-api.js
│ └── iterative-fallback.js
├── reference/ # Quick lookup
│ ├── report-schema.md # Intelligence report format (Sections 1-7)
│ ├── proxy-tool-reference.md # Proxy-MCP tools (80+)
│ ├── regex-patterns.md
│ ├── fingerprint-patterns.md
│ └── anti-patterns.md
├── apify/ # Production deployment
│ ├── typescript-first.md # Why TypeScript
│ ├── cli-workflow.md # apify create (CRITICAL)
│ ├── templates/ # TypeScript boilerplate
│ └── examples/ # Working actors
└── README.md # This file
This skill follows Anthropic's official best practices for skill development:
Pattern: Three-level loading system to manage context efficiently
Result: 70-80% token reduction vs monolithic documentation
Source: skill-creator/SKILL.md
Pattern: Write instructions using verb-first commands, not second-person language
Examples:
Exception: Second-person is acceptable in user-facing prompts, code comments, and tutorial examples
Source: skill-creator/SKILL.md
Pattern: Concise, specific name and description that determine when Claude invokes the skill
Applied:
name: web-scraping - Clear, hyphen-case identifierdescription: - Specific about activation triggers and capabilities (189 chars, optimized from 244)Source: agent_skills_spec.md
Pattern: Keep only essential procedural instructions in SKILL.md; move detailed information to subdirectories
Applied:
workflows/: Detailed implementation patternsstrategies/: Deep-dive guidesexamples/: Runnable codereference/: Quick lookup patternsapify/: Production deployment guidesSource: skill-creator/SKILL.md
Pattern: Separate executable code, documentation, and output resources
Applied:
examples/ - Executable JavaScript learning examples (like scripts/)workflows/, strategies/, reference/, apify/ - Documentation loaded as needed (like references/)apify/templates/, apify/examples/ - Boilerplate code and templates (like assets/)Source: skill-creator/SKILL.md
Pattern: Create focused skills for specific purposes rather than one skill that does everything
Applied: This skill focuses specifically on web scraping and Apify Actor development, not general web development
Source: Anthropic Skills Best Practices
Pattern: Use clear, technical language focused on "what" and "how" rather than persuasive or promotional tone
Applied: Direct technical guidance throughout ("Check for sitemaps", "Implement iteratively") vs. marketing language
Source: skill-creator/SKILL.md
Quality-gated workflow that skips unnecessary phases:
Uses strategies/framework-signatures.md lookup tables:
Reports follow reference/report-schema.md with:
Validated? column for every extraction strategy (YES / PARTIAL / NO)For production actors:
apify create command1. User: "Scrape example.com"
2. Phase 0: curl raw HTML → detect Next.js (__NEXT_DATA__), find product data in JSON
3. GATE A: All data in __NEXT_DATA__? → YES → Skip browser
4. Phase 3: Validate JSON paths resolve to expected values
5. Phase 5: Generate report with self-critique
6. Result: No browser needed, Cheerio + JSON parsing sufficient
1. User: "Scrape protected-shop.com"
2. Phase 0: curl returns 403 → protection detected, no data in HTML
3. GATE A: NO → Continue to Phase 1
4. Phase 1: Stealth browser loads page, traffic reveals API endpoint
5. GATE B: All data covered via API → Skip Phase 2
6. Phase 3: Replay API request, validate response structure
7. Phase 4: Protection testing (403 was detected) → stealth browser + proxy needed
8. Phase 5: Report + self-critique
9. Implements with discovered API + upstream proxies
10. Tests with 10 items, scales to full dataset
1. User: "Make this an Apify Actor"
2. Claude loads apify/ module
3. Recommends TypeScript? (Yes)
4. Guides through: apify cr