Unlock the full potential of browser.ai with CDP integration, enabling seamless control over browser automation. From cookie management to precise geo-targeting, BrowserAI empowers developers to optimize web scraping workflows using familiar Puppeteer and Playwright commands.
BrowserAI is fully CDP-compatible, meaning every Puppeteer function and feature works right out of the box. You can explore the complete Puppeteer API in the official Puppeteer docs. But we didn’t stop there—we’ve added custom CDP functions, fine-tuned for high-performance scraping and stealth browsing. Take full control of your automation stack and push the limits of what’s possible.The following are a few common browser navigation functions to get you started.
When using the BrowserAI, the same country-targeting parameter is available to use as in our other proxy products.
When setting up your script, add the -country flag, after your “USER” credentials, followed by the 2-letter ISO code for that country.
You can target the entire European Union region in the same manner as “Country” above by adding “eu” after “country” in your request: -country-eu
Requests sent using -country-eu will use IPs from one of the countries below which are included automatically within “eu”:
Countries
Copy
Ask AI
AL, AZ, KG, BA, UZ, BI, XK, SM, DE, AT, CH, UK, GB, IE, IM, FR, ES, NL, IT, PT, BE, AD, MT, MC, MA, LU, TN, DZ, GI, LI, SE, DK, FI, NO, AX, IS, GG, JE, EU, GL, VA, FX, FO
The allocation of a country within the EU is random.
BrowserAI’s built-in CAPTCHA solver automatically handles all CAPTCHAs, keeping your automation uninterrupted. Use custom CDP functions to monitor and fine-tune the solving process directly in your code.
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, BrowserAI automatically submits the form if required.
Use this command to return the status after the captcha was solved, failed, or not detected.
Copy
Ask AI
Captcha.solve({ detectTimeout?: number // Detect timeout in millisecond for solver to detect captcha options?: CaptchaOptions[] // Configuration options for captcha solving }) : SolveResult
Examples
Node.js
Python
Copy
Ask AI
const page = await browser.newPage();const client = await page.target().createCDPSession();await page.goto('[https://site-with-captcha.com](https://site-with-captcha.com/)'); // Note 1: If no captcha was found it will return not_detected status after detectTimeout // Note 2: Once a CAPTCHA is solved, if there is a form to submit, it will be submitted by default const client = await page.target().createCDPSession(); const {status} = await client.send('Captcha.solve', {detectTimeout: 30*1000}); console.log(`Captcha solve status: ${status}`)
Copy
Ask AI
page = await browser.new_page() client = await page.context.new_cdp_session(page) await page.goto('[https://site-with-captcha.com](https://site-with-captcha.com/)') # Note 1: If no captcha was found it will return not_detected status after detectTimeout # Note 2: Once a CAPTCHA is solved, if there is a form to submit, it will be submitted by default client = await page.context.new_cdp_session(page) solve_result = await client.send('Captcha.solve', { 'detectTimeout': 30*1000 }) status = solve_result['status'] print(f'Captcha solve status: {status}')
If CAPTCHA-solving fails, retry the process. If the issue persists, submit a support request with details of the problem for further assistance.
Custom functions for CAPTCHA status
Use the following functions to identify specific stages in the CAPTCHA-solving process and debug more effectively.:
Captcha.detected
browser.ai has encountered a CAPTCHA and has begun to solve it
Captcha.solveFinished
browser.ai successfully solved the CAPTCHA
Captcha.solveFailed
browser.ai failed in solving the CAPTCHA
Captcha.waitForSolve
browser.ai waits for CAPTCHA solver to finish
Examples
Asynchronous
Synchronous
The following code sets up a CDP session, listens for CAPTCHA events, and handles timeouts:
To manually configure or disable the default CAPTCHA solver—allowing you to call it manually or handle solving yourself—use the following CDP commands and settings.
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:
Copy
Ask AI
Captcha.setAutoSolve({ autoSolve: boolean // Whether to automatically solve captcha after navigate options?: CaptchaOptions[] // Configuration options for captcha auto-solving }) : void
Examples of CDP commands to disable auto-solver completely within the session:
Use this command to get a list of all possible devices that can be emulated. This function returns an array of device options that can be used with the setDevice command.
After retrieving the list of supported devices, you can emulate a specific device using the Emulation.setDevice command. This adjusts the screen width, height, userAgent, and devicePixelRatio to match the selected device.
Use this command to install custom client SSL/TLS certificates for domain authentication when required. These certificates remain active for the current BrowserAI session and are automatically removed when the session ends.
Browser.addCertificate
Copy
Ask AI
Browser.addCertificate(params: { cert: string // base64 encoded certificate file pass: string // password for the certificate}) : void
Code examples
Replace placeholder values USER:PASS with your valid BrowserAI 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.