Claude Agent SDK with Playwright
Pricing
Pay per usage
Go to Apify Store
Claude Agent SDK with Playwright
Under maintenanceGeneral web browsing/debugging agent that is decent at navigating production sites, extracting visual information. You'll need an ANTHROPIC_KEY_API to this actor that depends on Claude Agent SDK. No monetization, just sharing work.
0.0 (0)
Pricing
Pay per usage
0
1
1
Last modified
7 days ago
Claude Agent SDK + Playwright Actor
Run Claude Agent SDK with Playwright MCP as an Apify Actor. Good for evaluating UIs on the web in parallel and on a schedule. See ./example-prompt.md for reference.
Usage
Input Schema
{"task": "Navigate to example.com and extract the main heading","url": "https://example.com","anthropicApiKey": "sk-ant-...","outputDatasetId": "optional-dataset-id"}
Required Fields
task(string): Description of what Claude should do
Optional Fields
url(string): Starting URL to navigate toanthropicApiKey(string): Your Anthropic API key (or setANTHROPIC_API_KEYenv var)outputDatasetId(string): Specific dataset ID to push results to
Development
Local Setup
cd actor-claude-sdk-playwright# Install dependenciespip install uvuv sync# Run locallyuv run python -m actor_claude_sdk_playwright
Building the Actor
$apify build
Testing
$apify run -i input.json
Environment Variables
ANTHROPIC_API_KEY: Your Anthropic API key (required)APIFY_TOKEN: Apify API token (set automatically in Apify platform)
Gotchas
- Cloudflare challenge pages: Sites such as
chatgpt.commay return a Cloudflare Turnstile challenge, which the Playwright MCP server cannot solve. Complete the challenge manually in a regular browser (and pass any required cookies/session data to the actor) before continuing, or pick an automation-friendly target. - Anthropic API key: The actor fails fast if
ANTHROPIC_API_KEYis missing. Set it in the actor input (anthropicApiKey) or as an environment variable. - Browser bundle location: Chromium is preinstalled during the Docker build and stored under
/pw-browsers. If you ever changePLAYWRIGHT_BROWSERS_PATH, update.actor/Dockerfileaccordingly and rebuild withapify push --force.
File Storage
- Playwright MCP artifacts under
.playwright-mcpand newly created workspace documents (.html,.md,.json,.png, etc.) are uploaded to the run's default key-value store. Reference theartifacts,output_files, orstored_filesfields in the dataset output to retrieve them.



