/install patchright-stealth-browsing-skill
Patchright Stealth Browsing Skill
[!IMPORTANT] Hard Dependency Warning: This skill is strictly dependent on the
patchright-mcpserver. It will not work unless thepatchright-mcpserver is correctly installed, configured, and running in the OpenClaw environment.Repository Access: The
patchright-mcpserver repository is private. Accessing, cloning, and managing the server requires proper authentication credentials and repository privileges.
This skill enables the OpenClaw agent to automate browser interactions stealthily on websites protected by active anti-bot systems (e.g., Cloudflare, Akamai, Datadome). It runs over the patchright-mcp server, which uses a patched Chromium browser.
The browser capabilities are consolidated into four core tools:
patchright_navigation: Manages page lifecycle, navigation, HTML content retrieval, and screenshot captures.patchright_interaction: Executes clicks, text typing, option selections, scrolling, global keys, and elements synchronization.patchright_session: Handles reading, writing, and clearing context cookies.patchright_execution: Evaluates page scripts and extracts structured interactive element snapshots.
Guidelines for the Agent
-
Sequential Lifecycle Management:
- Begin by navigating directly using
patchright_navigationwith actionnavigateand the targeturl. - Always finish execution by calling
patchright_navigationwith actioncloseto safely release the browser process and memory.
- Begin by navigating directly using
-
Stealth Interaction Flow:
- To interact with a page, first get the structure using
patchright_executionwith actionsnapshot. This extracts all visible interactive elements (buttons, links, inputs) along with their CSS selectors. - Use the retrieved selectors to trigger clicks, hovers, or inputs via
patchright_interaction.
- To interact with a page, first get the structure using
-
Performance Optimization (Bulk Fill):
- When filling forms with multiple inputs, do not call
fillrepeatedly. Instead, usepatchright_interactionwith actionbulk_filland pass the list of fields in theitemsarray. This reduces roundtrips and handles fallback evaluations automatically.
- When filling forms with multiple inputs, do not call
-
Synchronizations and Waits:
- If pages load elements dynamically, synchronize using
patchright_interactionwith actionwait_fortargeting the element's selector and expected state (visible,hidden,attached, ordetached).
- If pages load elements dynamically, synchronize using
-
Visual Validation:
- Capture screenshots using
patchright_navigationwith actionscreenshotafter major actions (like form submissions or clicks) to verify the visual state of the page.
- Capture screenshots using
-
Authentication & Session Reuse:
- Use
patchright_sessionwith actionget_cookiesto save authentication state, andset_cookiesto restore sessions without needing to re-login.
- Use
-
Custom Client Configurations:
- You can dynamically override browser launch settings by passing parameters such as
headless,userAgent,viewport(e.g.{ "width": 800, "height": 600 }), anddeviceScaleFactorto theopenornavigateactions insidepatchright_navigation. - Use these overrides to simulate different device types (mobile/desktop viewports) or rotate user agents to prevent fingerprint-based blockings.
- You can dynamically override browser launch settings by passing parameters such as
Edge Cases and Failure Handling
-
Element Selector Timeouts:
- If an interaction (e.g.,
click,fill) fails due to a timeout, verify if the element is loaded by callingpatchright_interactionwith actionwait_forand statevisible. - If an element is hidden or obstructed by a modal, use
patchright_executionwith actionevaluateto trigger a native JS click:document.querySelector('selector').click().
- If an interaction (e.g.,
-
Isolated Context Variable Sharing:
- Remember that
evaluatescripts execute in an isolated context (utility world) for anti-bot stealth. - If you need to verify or set properties on the page's main execution context, store them as custom DOM attributes (e.g.,
element.setAttribute('data-state', 'value')) rather than attaching them directly towindow.propertyName.
- Remember that
-
Anti-bot Block Pages / CAPTCHAs:
- If you encounter a CAPTCHA or blocker page, do not repeat failing navigation commands.
- Run
patchright_navigationwith actionscreenshotto verify if a challenge is present. - If a challenge page appears, instruct the user or wait for manual solver actions, rather than retrying automated scripts recursively.
-
CDP Connection Disconnects:
- If the remote CDP port
9222falls back to a subprocess launch, verify if the process crashed by retryingopen. The server automatically spins up a local fallback browser if the remote socket is unresponsive.
- If the remote CDP port
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install patchright-stealth-browsing-skill - After installation, invoke the skill by name or use
/patchright-stealth-browsing-skill - Provide required inputs per the skill's parameter spec and get structured output
What is patchright-stealth-browsing?
Perform stealth browser automation to bypass bot detection (Cloudflare, Akamai, Datadome) using Patchright. It is an AI Agent Skill for Claude Code / OpenClaw, with 49 downloads so far.
How do I install patchright-stealth-browsing?
Run "/install patchright-stealth-browsing-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is patchright-stealth-browsing free?
Yes, patchright-stealth-browsing is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does patchright-stealth-browsing support?
patchright-stealth-browsing is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created patchright-stealth-browsing?
It is built and maintained by vk (@cyber-bye); the current version is v2.0.0.