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 从公开仓库中收录这些内容。

举报或申请下架