Langsung ke konten
Skillpedia
Web scraping29k ยท #9577

browser-automation

Fungsinya

Skill ini memberi agent alat dan pola untuk mengendalikan peramban dengan Playwright, untuk mengumpulkan data atau menyelesaikan tugas web yang berulang. Ditujukan untuk orang yang mengotomatiskan riset web, pengumpulan data, atau pekerjaan formulir.

Kapan dipakai

  • โœ“Saat Anda ingin data dikumpulkan dari sebuah situs web, seperti tabel atau hasil pencarian.
  • โœ“Ketika Anda memerlukan tugas web beberapa langkah, seperti mengisi formulir atau mengunduh file.
  • โœ“Saat Anda ingin tangkapan layar atau PDF dari halaman web dibuat secara otomatis.

Link skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/browser-automation/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/browser-automation/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin Anda mengumpulkan nama dan harga produk dari halaman daftar toko ini ke dalam spreadsheet.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengendalikan peramban dengan Playwright, menunggu halaman dimuat, mengekstrak konten, dan menyimpan hasilnya. Skrip pembantu membuat scraper dan alur formulir.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Browser Automation - POWERFUL

Overview

The Browser Automation skill provides comprehensive tools and knowledge for building production-grade web automation workflows using Playwright. This skill covers data extraction, form filling, screenshot capture, session management, and anti-detection patterns for reliable browser automation at scale.

When to use this skill:

  • Scraping structured data from websites (tables, listings, search results)
  • Automating multi-step browser workflows (login, fill forms, download files)
  • Capturing screenshots or PDFs of web pages
  • Extracting data from SPAs and JavaScript-heavy sites
  • Building repeatable browser-based data pipelines

When NOT to use this skill:

  • Writing browser tests or E2E test suites โ€” use playwright-pro instead
  • Testing API endpoints โ€” use api-test-suite-builder instead
  • Load testing or performance benchmarking โ€” use performance-profiler instead

Why Playwright over Selenium or Puppeteer:

  • Auto-wait built in โ€” no explicit sleep() or waitForElement() needed for most actions
  • Multi-browser from one API โ€” Chromium, Firefox, WebKit with zero config changes
  • Network interception โ€” block ads, mock responses, capture API calls natively
  • Browser contexts โ€” isolated sessions without spinning up new browser instances
  • Codegen โ€” playwright codegen records your actions and generates scripts
  • Async-first โ€” Python async/await for high-throughput scraping

Core Competencies

1. Web Scraping Patterns

Selector priority (most to least reliable):

  1. data-testid, data-id, or custom data attributes โ€” stable across redesigns
  2. #id selectors โ€” unique but may change between deploys
  3. Semantic selectors: article, nav, main, section โ€” resilient to CSS changes
  4. Class-based: .product-card, .price โ€” brittle if classes are generated (e.g., CSS modules)
  5. Positional: nth-child(), nth-of-type() โ€” last resort, breaks on layout changes

Use XPath only when CSS cannot express the relationship (e.g., ancestor traversal, text-based selection).

Pagination strategies: next-button, URL-based (?page=N), infinite scroll, load-more button. See data_extraction_recipes.md for complete pagination handlers and scroll patterns.

2. Form Filling & Multi-Step Workflows

Break multi-step forms into discrete functions per step. Each function fills fields, clicks "Next"/"Continue", and waits for the next step to load (URL change or DOM element).

Key patterns: login flows, multi-page forms, file uploads (including drag-and-drop zones), native and custom dropdown handling. See playwright_browser_api.md for complete API reference on fill(), select_option(), set_input_files(), and expect_file_chooser().

3. Screenshot & PDF Capture

  • Full page: await page.screenshot(path="full.png", full_page=True)
  • Element: await page.locator("div.chart").screenshot(path="chart.png")
  • PDF (Chromium only): await page.pdf(path="out.pdf", format="A4", print_background=True)
  • Visual regression: Take screenshots at known states, store baselines in version control with naming: {page}_{viewport}_{state}.png

See playwright_browser_api.md for full screenshot/PDF options.

4. Structured Data Extraction

Core extraction patterns:

  • Tables to JSON โ€” Extract <thead> headers and <tbody> rows into dictionaries
  • Listings to arrays โ€” Map repeating card elements using a field-selector map (supports ::attr() for attributes)
  • Nested/threaded data โ€” Recursive extraction for comments with replies, category trees

See data_extraction_recipes.md for complete extraction functions, price parsing, data cleaning utilities, and output format helpers (JSON, CSV, JSONL).

5. Cookie & Session Management

  • Save/restore cookies: context.cookies() and context.add_cookies()
  • Full storage state (cookies + localStorage): context.storage_state(path="state.json") to save, browser.new_context(storage_state="state.json") to restore

Best practice: Save state after login, reuse across scraping sessions. Check session validity before starting a long job โ€” make a lightweight request to a protected page and verify you are not redirected to login. See playwright_browser_api.md

Pertanyaan umum

Apakah ini untuk menguji situs web?

Tidak. Tes peramban ditangani oleh skill lain, yaitu playwright-pro.

Bisakah menangani situs yang berat JavaScript?

Bisa. Skill ini mencakup ekstraksi data dari aplikasi halaman tunggal (single-page app) yang memuat konten dengan JavaScript.

Bisakah berjalan di beberapa peramban?

Bisa. Playwright mendukung Chromium, Firefox, dan WebKit dari satu antarmuka.

Detail

Deskripsi asli dari pembuat

Use for browser automation, scraping, form filling or structured extraction from web pages. Builds scrapers with scraping_toolkit.py and form flows with form_automation_builder.py. Browser testing: playwright-pro.

repo: alirezarezvani/claude-skills

Popularitas

Bintang GitHub
29k
Peringkat
#9577
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa