browsing-with-playwright
Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction. NOT when only fetching static content (use curl/wget instead).
By bilalmk · 1,704 installs
npx skills add bilalmk/todo_correct --skill browsing-with-playwright
Source repository · Upstream listing
Browser Automation
Automate browser interactions via Playwright MCP server.
Server Lifecycle
Start Server
Stop Server
When to Stop
End of task : Stop when browser work is complete
Long sessions : Keep running if doing multiple browser tasks
Errors : Stop and restart if browser becomes unresponsive
Important: The shared browser context flag is required to maintain browser state across multiple mcp client.py calls. Without it, each call gets a fresh browser context.
Quick Reference
Navigation
Get Page State
Interact with Elements
Use ref from snapshot output to target elements:
Wait for Conditions
Execute JavaScript
Multi Step Playwright Code
For complex workflows, use browser run code to run multiple actions in one call:
Tip: Use browser run code for complex multi step operations that should be atomic (all or nothing).
Workflow: Form Submission
1. Navigate to page
2. Get snapshot to find element refs
3. Fill form fields using refs
4. Click submit
5. Wait for confirmation
6. Screenshot result
Workflow: Data Extraction
1. Navigate to page
2. Get snapshot (contains text content)
3. Use browser evaluate for complex extraction
4. Process results
Verification
Run: python3 scripts/verify.py
Expected: ✓ Playwright MCP server running
If Verification Fails
1. Run diagnostic: pgrep f "@playwright/mcp"
2. Check: Server process running on port 8808
3. Try: bash scripts/start server.sh
4. Stop and report if still failing do not proceed with downstream steps
Tool Reference
See [references/playwright tools.md](references/playwright tools.md) for complete tool documentation.
Troubleshooting
Issue Solution
Element not found Run browser snapshot first to get current refs
Click fails Try browser hover first, then click
Form not submitting Use "submit": true with browser type
Page not loading Increase wait time or use browser wait for
Server not responding Stop and restart: bash scripts/stop server.sh && bash scripts/start server.sh