agentleFS
roedyrustamroedyrustam/vibes-plug/.cursor/skills/web-scraper/SKILL.md

web-scraper

Skill129 starsChanged 12 days agoMITView on GitHub

Agentic web scraping: Crawl4AI, Firecrawl, and anti-bot bypass / Ekstraksi web agentic: Crawl4AI, Firecrawl, dan bypass anti-bot.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use content-topic-generator, image-skill-builder and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zephyrwang6Skill

    content-topic-generator

    从文章、推文、社交媒体内容生成多角度选题,包括推文选题(140字完整内容)和公众号选题(含详细大纲)。支持延伸、反驳、扩充、热点结合四种策略。当用户需要基于现有内容创作新选题、分析文章生成衍生内容、或进行内容再创作时使用。适用场景:(1) 分析推文/文章并生成选题,(2) 创建公众号/社交媒体内容策划,(3) 将长文拆解为多个传播点,(4) 内容营销和话题策划。

    Also in 4 projects that use this

  • zephyrwang6Skill

    image-skill-builder

    帮助用户通过交互式问答创建自定义批量生图 Skill。用户不需要写代码,只需回答问题即可生成完整可用的生图 Skill。当用户说"帮我创建生图Skill"、"我想做一个配图技能"、"创建批量出图的Skill"、"生成图片的Skill怎么做"、"帮我做一个AI画图技能"时触发。支持文章配图、Logo设计、分镜故事、社交媒体图、海报等任意图片场景。

    Also in 3 projects that use this

  • +10 more from zephyrwang6

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Crawl4AI v4 for high-performance async extraction and Firecrawl for seamless LLM-ready conversion.

    line 49
  2. Very specific:

    Browser Fingerprinting: Use tools like playwright-stealth or specialized stealth browsers (e.g., Undetected ChromeDriver, Curl-Impersonate) …

    line 97
  3. Distinctive:

    Use CSS piercing selectors or JavaScript execution to penetrate the Shadow Root.

    line 100

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agentic Web Scraper Expert (2026 Edition)

English | Bahasa Indonesia


<a name="english"></a>

English

Orchestration & Integration

  • Upstream Orchestrators: Works under brainstorming and zero-to-prod-orchestrator (Phase 1 & Phase 5 - Extraction & Data Pipelines) to gather web data.
  • Downstream Cooperating Skills:
    • browser-automation-expert — Hardcore anti-bot evasion, stealth Playwright execution, and Cloudflare bypass.
    • ai-llm-integration-expert — LLM schema-driven structured data extraction from DOM markdown.
    • deep-research-analyst — Feed extracted web sources to multi-source evidence synthesis.
    • data-pipeline-etl-expert — Ingest extracted datasets into transformation and analytics storage.
    • session-memory-manager — Cache scraped web structures and extraction progress checkpoints.
  • Cross-Domain Synergy & Subagent Swarm Integration: website-design-cloner, search-engine-expert

Description

Advanced Agentic Web Scraping utilizing modern multi-strategy data extraction. Leverages Crawl4AI v4 and Firecrawl to convert raw DOMs into LLM-friendly Markdown. Implements Agentic Extraction loops where the LLM guides the scraper dynamically based on page state. Incorporates strategies for bypassing anti-bot measures (Cloudflare Turnstile, Datadome) and navigating dynamic Shadow DOMs.

Hard Guardrails (Declarative Invariants)

  • Stealth Browser Identity & Anti-Bot Evasion: Direct automated scraping requests using default unmasked client user-agents (e.g. raw axios, unconfigured python-requests, standard unpatched Playwright) against protected endpoints without proxy rotation and fingerprint masking are strictly prohibited.
  • Concurrency Throttling & Rate Invariant: Batch scraping loops must enforce explicit concurrency limits ($C \le 5$ default) with rate limiting and exponential backoff; unbounded Promise.all(urls.map(scrape)) or thread hammering is banned.
  • Clean Markdown DOM Transformation: Scraping pipelines destined for LLM ingestion must sanitize and strip inline scripts, style tags, SVG path data, and tracking pixels, converting DOM trees into structured Markdown (Crawl4AI / Firecrawl).
  • Robots & Terms Compliance Gate: Scraping workflows must parse robots.txt disallow rules and honor HTTP 429 Too Many Requests / Retry-After headers immediately without retry bombardment.

Non-Functional Requirements (NFR Contract)

  • DOM-to-Markdown Signal Ratio: Content extraction fidelity must maintain $\ge 95%$ signal-to-noise ratio without phantom HTML artifacts.
  • Memory Safety & Worker Recycling: Scraping batch workers must release browser context pages immediately after extraction to keep process RSS $< 512\text{ MB}$.

Trigger Conditions

  • Extracting structured data from websites for analysis, training data, or content pipelines.
  • Scraping dynamic JavaScript-rendered pages and complex SPAs.
  • Converting web pages to clean Markdown for LLM context or RAG pipelines.
  • Dealing with anti-bot protections or complex Shadow DOM architectures during scraping.
  • Implementing an automated agentic data extraction loop.

Extracting DOM into LLM-Friendly Markdown

Use Crawl4AI v4 for high-performance async extraction and Firecrawl for seamless LLM-ready conversion.

Crawl4AI v4 (Async Python):

import asyncio
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode

async def extract_markdown(url: str):
    config = BrowserConfig(headless=True, bypass_csp=True)
    run_config = CrawlerRunConfig(
        cache_mode=CacheMode.ENABLED,
        remove_overlay_elements=True,
        word_count_threshold=50
    )
    
    async with AsyncWebCrawler(config=config) as crawler:
        result = await crawler.arun(url=url, config=run_config)
        # Returns clean, AI-optimized markdown ready for LLM consumption
        return result.markdown.fit_markdown

Firecrawl (Managed API):

from firecrawl import FirecrawlApp
from pydantic import BaseModel

app = FirecrawlApp(api_key="fc-xxxx")

class ExtractionSchema(BaseModel):
    title: str
    content: str
    key_metrics: list[str]

# Single API call to extract structured data based on JSON schema
result = app.scrape_url(
    "https://example.com/data",
    formats=["extract", "markdown"],
    extract={"schema": ExtractionSchema.model_json_schema()}
)
print(result.markdown) # Clean markdown
print(result.extract)  # Structured JSON

Anti-Bot Bypass & Shadow DOMs

Scraping modern web apps requires bypassing anti-bot measures like Cloudflare Turnstile and Datadome, as well as accessing deeply nested elements.

  1. Anti-Bot Bypass (Cloudflare Turnstile, Datadome):
    • Residential Proxies: Rotate high-quality residential IPs to avoid datacenter IP bans.
    • Browser Fingerprinting: Use tools like playwright-stealth or specialized stealth browsers (e.g., Undetected ChromeDriver, Curl-Impersonate) to mask automated fingerprints (WebGL, Canvas, User-Agent).
    • Human-like Interaction: Introduce random delays, simulate realistic mouse movements, and handle CAPTCHAs via third-party solving services only when necessary.
  2. Dynamic Shadow DOMs:
    • Use CSS piercing selectors or JavaScript execution to penetrate the Shadow Root.
    • Example (Playwright): await page.locator('my-web-component >> css=.internal-element').text_content()
    • Recursively traverse the DOM tree injecting scripts to extract content from encapsulated components.

Agentic Extraction Loops

Implement an autonomous loop where an LLM guides the scraper based on the current page state, rather than relying on brittle CSS selectors.

  1. Observe: The scraper extracts the current DOM into clean Markdown.
  2. Analyze: The LLM analyzes the Markdown to identify necessary data or the next interaction step (e.g., "Click the 'Load More' button").
  3. Act: The LLM issues a command (extract data, navigate, click, fill form).
  4. Loop: Repeat until the extraction goal is met.
async def agentic_scrape_loop(url: str, goal: str):
    current_url = url
    while True:
        markdown_content = await extract_markdown(current_url)
        # LLM analyzes state and decides next action
        action = await llm_decide_action(markdown_content, goal)
        
        if action.type == "COMPLETE":
            return action.extracted_data
        elif action.type == "CLICK":
            await click_element(action.target_selector)
        elif action.type == "NAVIGATE":
            current_url = action.new_url

Ethical Scraping Checklist

  • Check robots.txt and respect Disallow rules.
  • Implement rate limiting.
  • Use descriptive User-Agent headers.
  • Do not scrape personal/private data without consent.

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeHigh Fast / Medium / High (Gemini 4 Carbon/Hydrogen/Neon/Argon/Pro, Grok 4.7 High Fast, Claude Sonnet/Opus 5.5, GPT-5.6 Sol)
Availability FallbackGemini 4 (Carbon/Hydrogen/Neon/Argon/Pro) -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec web-scraper <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
NFR & Anti-Slop InvariantsP99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Integrasi Orkestrasi

  • Orkestrator Hulu: Beroperasi di bawah arahan brainstorming dan zero-to-prod-orchestrator (Fase 1 & Fase 5 - Ekstraksi & Pipeline Data) untuk mengumpulkan data web.
  • Skill Hilir & Kerja Sama:
    • browser-automation-expert — Bypass proteksi anti-bot, eksekusi stealth Playwright, dan Cloudflare bypass.
    • ai-llm-integration-expert — Ekstraksi data terstruktur berbasis skema LLM dari DOM markdown.
    • deep-research-analyst — Menyalurkan sumber web terekstraksi ke sintesis bukti multi-sumber.
    • data-pipeline-etl-expert — Memasukkan dataset ekstraksi ke pipeline transformasi dan analitik.
    • session-memory-manager — Menyimpan cache struktur web dan checkpoint progres ekstraksi.
  • Sinergi Lintas Domain & Integrasi Swarm Subagent: website-design-cloner, search-engine-expert

Deskripsi

Scraping Web Agentic tingkat lanjut menggunakan ekstraksi data multi-strategi modern. Memanfaatkan Crawl4AI v4 dan Firecrawl untuk mengubah DOM mentah menjadi Markdown yang ramah LLM. Mengimplementasikan loop Ekstraksi Agentic di mana LLM memandu scraper secara dinamis berdasarkan status halaman. Menggabungkan strategi untuk melewati tindakan anti-bot (Cloudflare Turnstile, Datadome) dan menavigasi Shadow DOM yang dinamis.

Hard Guardrails (Invarian Deklaratif - Bahasa Indonesia)

  • Identitas Browser Siluman & Evasif Anti-Bot: Permintaan scraping otomatis langsung menggunakan user-agent bawaan tanpa masking (misal axios polos, python-requests tanpa konfigurasi, Playwright standar tanpa patch) ke endpoint terproteksi tanpa rotasi proxy dilarang keras.
  • Pembatasan Konkurensi & Invarian Laju: Loop scraping batch wajib menerapkan batas konkurensi eksplisit ($C \le 5$ default) dengan pembatasan laju dan backoff eksponensial; pemanggilan Promise.all(urls.map(scrape)) tanpa batas dilarang.
  • Transformasi DOM Bersih ke Markdown: Pipeline scraping untuk konsumsi LLM wajib membersihkan tag script inline, style, data SVG path, dan pixel pelacak, mengonversi pohon DOM menjadi Markdown terstruktur (Crawl4AI / Firecrawl).
  • Kepatuhan Robots.txt & Batas Permintaan: Alur scraping wajib mematuhi aturan disallow robots.txt dan merespons header HTTP 429 Too Many Requests / Retry-After seketika tanpa melakukan penyerangan request berulang.

Non-Functional Requirements (Kontrak NFR - Bahasa Indonesia)

  • Rasio Signal-to-Noise DOM-ke-Markdown: Fidelitas ekstraksi konten wajib mempertahankan rasio sinyal $\ge 95%$ tanpa artefak HTML liar.
  • Keamanan Memori & Daur Ulang Worker: Worker batch scraping wajib melepaskan page context browser segera setelah ekstraksi agar penggunaan memori RSS proses tetap $< 512\text{ MB}$.

Kondisi Pemicu

  • Mengekstrak data terstruktur dari situs web untuk analisis, data pelatihan, atau pipeline konten.
  • Scraping halaman yang dirender JavaScript secara dinamis dan SPA kompleks.
  • Mengonversi halaman web menjadi Markdown bersih untuk konteks LLM atau pipeline RAG.
  • Menghadapi perlindungan anti-bot atau arsitektur Shadow DOM yang kompleks saat scraping.
  • Mengimplementasikan loop ekstraksi data agentic otomatis.

Mengekstrak DOM menjadi Markdown Ramah LLM

Gunakan Crawl4AI v4 untuk ekstraksi async berperforma tinggi dan Firecrawl untuk konversi siap LLM yang mulus. (Lihat contoh kode di bagian bahasa Inggris).

Bypass Anti-Bot & Shadow DOM

  1. Bypass Anti-Bot (Cloudflare Turnstile, Datadome):
    • Proxy Residensial: Rotasi IP residensial berkualitas tinggi untuk menghindari pemblokiran IP datacenter.
    • Browser Fingerprinting: Gunakan alat seperti playwright-stealth atau browser stealth khusus untuk menyembunyikan sidik jari otomatis.
    • Interaksi Mirip Manusia: Tambahkan penundaan acak, simulasikan gerakan mouse yang realistis.
  2. Shadow DOM Dinamis:
    • Gunakan selektor penembus CSS atau eksekusi JavaScript untuk menembus Shadow Root.
    • Telusuri pohon DOM secara rekursif dengan menyuntikkan skrip untuk mengekstrak konten.

Loop Ekstraksi Agentic

Implementasikan loop otonom di mana LLM memandu scraper berdasarkan status halaman saat ini, bukan bergantung pada selektor CSS yang rentan rusak.

  1. Observasi: Scraper mengekstrak DOM saat ini menjadi Markdown yang bersih.
  2. Analisis: LLM menganalisis Markdown untuk mengidentifikasi data yang diperlukan atau langkah interaksi selanjutnya (misal: "Klik tombol 'Muat Lebih Banyak'").
  3. Aksi: LLM mengeluarkan perintah (ekstrak data, navigasi, klik, isi form).
  4. Loop: Ulangi hingga tujuan ekstraksi tercapai.

Checklist Scraping Etis

  • Periksa robots.txt dan hormati aturan Disallow.
  • Implementasikan rate limiting.
  • Gunakan header User-Agent yang deskriptif.
  • Jangan scraping data pribadi/privat tanpa izin.

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierHigh Fast / Medium / High (Gemini 4 Carbon/Hydrogen/Neon/Argon/Pro, Grok 4.7 High Fast, Claude Sonnet/Opus 5.5, GPT-5.6 Sol)
Invarian Fallback KetersediaanGemini 4 (Carbon/Hydrogen/Neon/Argon/Pro) -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec web-scraper <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
Invarian NFR & Anti-SlopLatensi P99 API < 85ms, paritas skema ketat OpenAPI 3.1 / TypeSpec, kontrak error RFC 9457 Problem Details, penegakan Idempotency-Key; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.