- Home
- Skills
- Testing & Debugging
- Browser Automation with Playwright
Works with the AI Agents you already use
Browser Automation with Playwright
When official APIs are unavailable or rate-limited, you need a reliable way to interact with the web.
Free
Browser Automation with Playwright
Example session with this skill installed
Navigate to the pricing page of example.com, extract the names of all available plans, and save a full-page screenshot.
- Read your context and instructions
- Compiled the browser automation
I have executed the browser automation script to extract the pricing plans and capture a visual record of the page.
Extraction Results
| Plan Name | Source URL | Screenshot Path |
|---|---|---|
| Basic | https://example.com/pricing | browser-output/pricing.png |
| Professional | https://example.com/pricing | browser-output/pricing.png |
| Enterprise | https://example.com/pricing | browser-output/pricing.png |
Automation Script
import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch({ headless: true });
const ctx = await browser.newContext({ viewport: { width: 1280, height: 800 } });
const page = await ctx.newPage();
try {
await page.goto('https://example.com/pricing', { waitUntil: 'domcontentloaded' });
// Extract plan names using role-based selectors
const plans = await page.getByRole('heading', { level: 3 }).allInnerTexts();
// Capture full-page artifact
await page.screenshot({ path: 'browser-output/pricing.png', fullPage: true });
console.log('Extracted Plans:', JSON.stringify(plans));
} catch (error) {
console.error('Automation failed:', error);
} finally {
await browser.close();
}
})();
Next steps
- Inspect
browser-output/pricing.pngto verify the layout was captured correctly. - Update the script with
storageState: 'auth.json'if the pricing page moves behind a login wall. - Integrate the console output into your downstream data pipeline.
Connects securely to your tools. The creator never sees your data.
About this skill
When official APIs are unavailable or rate-limited, you need a reliable way to interact with the web. This skill enables your agent to drive a real browser to navigate sites, handle complex UI interactions, and extract data that simple scrapers miss. It focuses on stability by using accessibility-tree selectors rather than brittle CSS paths.
What it does
- Automated Navigation executes multi-step workflows across different domains and page states.
- Data Extraction scrapes text, table data, and attributes from dynamic, JavaScript-heavy websites.
- Form Automation fills and submits forms, handles dropdowns, and manages file uploads.
- Visual Verification captures full-page or element-specific screenshots to confirm UI state.
- Session Management saves and reuses authentication states to bypass repetitive login steps.
- Network Monitoring intercepts JSON responses directly from internal APIs for cleaner data.
How it works
- Discovery involves opening the target URL to capture accessibility snapshots and screenshots for selector identification.
- Scripting generates a Playwright script using stable locators like
getByRoleorgetByLabel. - Execution runs the automation in headless mode, handling iframes, popups, and pagination.
- Validation asserts that expected elements are visible or URLs have changed before proceeding.
Frameworks & tools
This skill requires Node.js or Python with the Playwright library installed. It primarily targets the Chromium browser but supports standard Playwright configurations.
Why this beats prompting it yourself
Standard prompts often produce brittle scripts using auto-generated CSS classes that break on the next deployment. This skill enforces the use of the accessibility tree and auto-waiting locators, ensuring your automation survives UI updates.
Use cases
- E2E Testing of web applications by simulating real user journeys and asserting outcomes.
- Competitor Research by monitoring pricing pages or product catalogs where no API exists.
- Internal Ops such as automating report downloads from legacy portals.
- Lead Gen by extracting contact information from directory listings with pagination.
Known limitations
Does not bypass CAPTCHAs or bot protection. Requires local installation of Playwright and browser binaries. Manual intervention is required for initial login sessions to save authentication state.
Requires Playwright and browser binaries. Cannot bypass CAPTCHAs. User must manually handle initial logins for session saving.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
This skill has been used 7 times.
Trust & safety
Security scan
Security scan passed 7 days ago
- Free with an Agensi account
Requires