Captcha Solver
When navigating a page with Browser API, our integrated CAPTCHA solver automatically solves all CAPTCHAs by default. You can monitor this auto-solving process in your code with the following custom CDP functions.If you would like to disable CAPTCHA solver entirely through the Control Panel see our feature for Disable Captcha Solver
Once a CAPTCHA is solved, if there is a form to submit, it will be submitted by default.
CAPTCHA Solver - Automatic Solve
Captcha.solve
Captcha.solve
Use this command to return the status after the captcha was solved, failed, or not detected.Examples
If CAPTCHA-solving fails, please attempt a retry. If the issue persists, submit a support reques detailing the specific problem you encountered.
Custom CDP commands for CAPTCHA status
Custom CDP commands for CAPTCHA status
Use the commands below to pinpoint a more specific stage in the CAPTCHA solving flow:
Examples
Captcha.detected | Browser API has encountered a CAPTCHA and has begun to solve it |
Captcha.solveFinished | Browser API successfully solved the CAPTCHA |
Captcha.solveFailed | Browser API failed in solving the CAPTCHA |
Captcha.waitForSolve | Browser API waits for CAPTCHA solver to finish |
The following code sets up a CDP session, listens for CAPTCHA events, and handles timeouts:
CAPTCHA Solver - Manual Control
If you would like to either manually configure or fully disable our default CAPTCHA solver and instead call the solver manually or solve on your own, see the following CDP commands and functionality.Captcha.setAutoSolve
Captcha.setAutoSolve
This command is used to control the auto-solving of a CAPTCHA. You can disable auto-solve or configure algorithms for different CAPTCHA types and manually trigger this:Examples of CDP commands to disable auto-solver completely within the session:
Disable auto-solver for a specific CAPTCHA type only - Examples
Disable auto-solver for a specific CAPTCHA type only - Examples
Manually solving CAPTCHAs - Examples
Manually solving CAPTCHAs - Examples
CaptchaOptions for other Captcha types
CaptchaOptions for other Captcha types
For the following three CAPTCHA types we support the following additional options to control and configure our auto-solving algorithm.
CF Challenge
Emulation Functions
Emulation.getSupportedDevices
Emulation.getSupportedDevices
Use this command to get a list of all possible devices that can be emulated. This method returns an array of device options that can be used with the setDevice command.
Example
Emulation.setDevice
Emulation.setDevice
Once you’ve received the list above of supported devices, you can emulate a specific device using the Emulation.setDevice command. This command changes the screen width, height, userAgent, and devicePixelRatio to match the specified device.
Landscape mode
If you wish to change the orientation to landscape (for devices that support it), add the stringlandscape
after the device_name
.Example
Ad Blocker
Enabling ourAdBlock
feature can help reduce bandwidth usage and improve performance on ad-heavy websites.
CDP Commands
Unblocker.enableAdBlock
– Enables ad blocker (default: off)Unblocker.disableAdBlock
– Disables ad blocker
We recommend enabling ad blocking before navigating to the target page.
Example
Session Persistence
Use this command to reuse the same proxy peer across multiple browsing sessions. This is useful for scenarios where maintaining a consistent session is required, such as preserving browser states or IP-based continuity.CDP Commands
Proxy.useSession
– Associates a session with a specific session ID.sessionId
– A unique string that identifies your session.
Use the CDP command before navigation to the target page.
Example
See the full session persistence example script.
File Download
You can automate file downloads in your Browser API flows using the custom Download CDP domain. This is useful for workflows that require downloading files (e.g., CSV, PDF) directly during browser automation.CDP Commands
Download.enable
– Enables file downloads for specified content types.Download.downloadRequest
– Fires when request results in download.Download.getLastCompleted
– Retrieves information about the last completed download.Download.getDownloadedBody
– Gets the actual downloaded file content.
Example
See the full file download example script.
Faster Text Input
For scenarios that need rapid or bulk text input, use the custom Input.type CDP command. This approach is much faster than standard CDP text input methods, making it well suited for automation tasks requiring high-speed typing or handling large volumes of text.CDP Commands
Input.type
- Sends keystrokes or simulates typing the specified text into the currently focused element.
Example
Custom Client SSL/TLS Certificates
Use this command to install custom client SSL/TLS certificates where required for specific domain authentication. These certificates are applied for the duration of a single Browser API session and are automatically removed once the session ends.Browser.addCertificate
Browser.addCertificate
Code examples
Code examples
-
Replace placeholder values
SBR_ZONE_FULL_USERNAME:SBR_ZONE_PASSWORD
with your valid Browser API credentials. -
Replace
client.pfx
with the actual path to your certificate file. This file should be a valid SSL/TLS client certificate in .pfx format. -
Replace
secret
with the actual password for the certificate.