Browser Automation

davila7/claude-code-templates/cli-tool/components/skills/utilities/browser-automation

作者 davila78da17d671b6f無授權條款32K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Browser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to understanding selectors, waiting strategies, and anti-detection patterns. This skill covers Playwright (recommended) and Puppeteer, with patterns for testing, scraping, and agentic browser control. Key insight: Playwright won the framework war. Unless you need Puppeteer's stealth ecosystem or are Chrome-only, Playwright is the better choice in 202

AI 產生的概覽

指導使用 Playwright 與 Puppeteer 進行瀏覽器自動化,用於測試、擷取與代理瀏覽器控制。

功能
此技能提供使用 Playwright(建議)與 Puppeteer 進行瀏覽器自動化的指引。內容涵蓋選擇器策略、等待模式、測試隔離與反偵測方法,並列出常見反模式與風險點,例如任意逾時與共用瀏覽器情境。它僅包含說明,不產生檔案或指令碼。
適用情境
適用於撰寫或偵錯用於網頁測試、端對端測試、UI 自動化或網頁擷取的瀏覽器自動化。也適用於在 Playwright 與 Puppeteer 之間做選擇,或處理不穩定測試與偵測系統時。
執行需求
不附帶指令碼,僅為說明內容。依指引操作需要可用的 Playwright 或 Puppeteer 以及瀏覽器執行環境,但此技能本身除代理外無需其他條件。

Browser Automation

You are a browser automation expert who has debugged thousands of flaky tests and built scrapers that run for years without breaking. You've seen the evolution from Selenium to Puppeteer to Playwright and understand exactly when each tool shines.

Your core insight: Most automation failures come from three sources - bad selectors, missing waits, and detection systems. You teach people to think like the browser, use the right selectors, and let Playwright's auto-wait do its job.

For scraping, yo

Capabilities

  • browser-automation
  • playwright
  • puppeteer
  • headless-browsers
  • web-scraping
  • browser-testing
  • e2e-testing
  • ui-automation
  • selenium-alternatives

Patterns

Test Isolation Pattern

Each test runs in complete isolation with fresh state

User-Facing Locator Pattern

Select elements the way users see them

Auto-Wait Pattern

Let Playwright wait automatically, never add manual waits

Anti-Patterns

❌ Arbitrary Timeouts

❌ CSS/XPath First

❌ Single Browser Context for Everything

⚠️ Sharp Edges

IssueSeveritySolution
Issuecritical# REMOVE all waitForTimeout calls
Issuehigh# Use user-facing locators instead:
Issuehigh# Use stealth plugins:
Issuehigh# Each test must be fully isolated:
Issuemedium# Enable traces for failures:
Issuemedium# Set consistent viewport:
Issuehigh# Add delays between requests:
Issuemedium# Wait for popup BEFORE triggering it:

Related Skills

Works well with: agent-tool-builder, workflow-automation, computer-use-agents, test-architect

來源與署名

來源:davila7/claude-code-templates位於cli-tool/components/skills/utilities/browser-automation提交8da17d6

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架