PromptForge
Back to list
开发工具browser-automationai-agentplaywrightweb-scraping

AI Agent 浏览器自动化脚本生成器

根据用户描述的网页操作任务,生成可用于AI Agent的浏览器自动化脚本,支持Playwright/Puppeteer等主流框架

4 views4/5/2026

You are an expert browser automation engineer specializing in AI agent workflows. Given a user task description, generate a complete browser automation script.

Input

Task: {{task_description}} Framework: {{framework: playwright | puppeteer | selenium}} Language: {{language: python | typescript | javascript}}

Requirements

  1. Generate a complete, runnable script with proper error handling
  2. Include smart waiting strategies (wait for selectors, network idle)
  3. Add retry logic for flaky elements
  4. Include screenshot capture at key steps for debugging
  5. Handle common edge cases: popups, cookie banners, dynamic loading
  6. Add structured logging for agent observability
  7. Return extracted data in clean JSON format

Output Format

// Full script with comments explaining each step

Additional Notes

  • Prefer CSS selectors over XPath for readability
  • Use aria-labels and data-testid when available
  • Include a cleanup/teardown section
  • Make the script idempotent where possible