playwright-browser-automation
Browser automation using Playwright API directly. Navigate websites, interact with elements, extract data, take screenshots, generate PDFs, record videos, and automate complex workflows. More reliable than MCP approach.
Why use this skill?
Automate web browser tasks with Playwright. Navigate, interact, scrape data, take screenshots, and generate PDFs reliably.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/spiceman161/playwright-browser-automationWhat This Skill Does
The playwright-browser-automation skill provides direct access to the Playwright API, enabling sophisticated browser automation capabilities. Unlike approaches that might rely on intermediate layers, this skill allows for precise control over web browser interactions. Users can navigate websites, interact with virtually any element on a page (buttons, forms, links), and extract data from web pages. It also supports advanced features such as taking screenshots, generating PDF documents from web pages, and recording video of the automation process. This method is designed to be more reliable and robust than other potential automation methods, offering a powerful tool for automating complex web-based workflows.
Installation
To install the Playwright browser automation skill, you will need to use the clawhub command-line tool.
clawhub install openclaw/skills/skills/spiceman161/playwright-browser-automation
Additionally, Playwright requires its own browser binaries. After installing the skill, you may need to install these separately. For example, to install the Chromium browser (which is often used by default):
npx playwright install chromium
Refer to the Playwright documentation for installing other browsers like Firefox or WebKit if needed.
Use Cases
This skill is ideal for a wide range of tasks involving web browser interaction:
- Web Scraping: Extracting structured data from websites, such as product prices, contact information, or news articles.
- Automated Testing: Performing end-to-end testing of web applications by simulating user interactions.
- Data Entry & Form Submission: Automating the process of filling out and submitting online forms.
- Content Generation: Creating reports or documentation by capturing screenshots or generating PDFs of web pages.
- Workflow Automation: Automating multi-step processes that occur within a web browser, such as logging into multiple systems or processing data across different web applications.
- Monitoring: Regularly checking websites for changes or specific content.
Example Prompts
- "Automate logging into the admin panel at
https://example.com/adminusing usernameadminand passwordpassword123, then navigate to the 'Users' section and extract all user emails into a CSV file." - "Take a screenshot of the main page of
https://www.nasa.govand save it asnasa_homepage.png. Then, generate a PDF of the page titled 'NASA Homepage'." - "Navigate to
https://github.com/openclaw/skillsand extract the names and descriptions of the top 5 repositories, then output this data as a JSON array."
Tips & Limitations
- Reliability: Playwright's auto-waiting and retry mechanisms significantly enhance reliability compared to simple
setTimeoutor fixed delays. LeveragegetByRole,getByText, andgetByPlaceholderfor more resilient selectors. - Dynamic Content: Websites with heavy JavaScript or single-page applications (SPAs) might require explicit waits for elements to appear or for network activity to subside (
waitUntil: 'networkidle'). - Headless Mode: By default, Playwright runs in
headless: truemode (no visible browser window). For debugging, you can setheadless: falsein your script to observe the automation in real-time. - Context Isolation: Use
browser.newContext()to create isolated browser sessions, ensuring cookies, local storage, and cache do not interfere between different automation tasks. - Error Handling: Implement robust error handling (e.g., using
try...catchblocks) to gracefully manage unexpected page states or network issues. - Resource Intensive: Browser automation can be resource-intensive, especially when running multiple instances or complex tasks. Ensure your system has sufficient RAM and CPU.
- Terms of Service: Be mindful of website
robots.txtfiles and Terms of Service when scraping or automating interactions, as excessive or aggressive automation can lead to being blocked.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-spiceman161-playwright-browser-automation": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, network-access, code-execution
Related Skills
sys-updater
System package maintenance for Ubuntu (apt), npm, brew, and OpenClaw skills. Conservative workflow with 2-day quarantine for non-security updates, automatic security updates, and scheduled reviews with web search for bug assessment.
playwright-mcp
Browser automation via Playwright MCP server. Navigate websites, click elements, fill forms, extract data, take screenshots, and perform full browser automation workflows.