Skip to main content
All integrations

Browser automation

AdsCrawl for Puppeteer

Run your Puppeteer automation against AdsCrawl's remote Chromium browsers. Create a CDP session, connect with your existing library, perform browser actions, and release the session when the work ends.

What you can do

01

Reuse browser code

Keep page navigation, selectors, clicks and form input in your existing automation library.

02

State within a session

Reuse pages and browser context for related steps without creating a browser for every request.

03

Inspect the result

Read DOM content and save screenshots using your browser library, then close the remote session.

Before you start

  • Node.js 20+
  • An AdsCrawl account and API key.
  • Set ADSCRAWL_API_KEY in the environment of the process running your client. Keep it out of browser code and source control.

SETUP METHOD 01

Remote CDP

Discover the WebSocket endpoint with client.cdp.getVersion before puppeteer.connect.

  1. Install the clients

    The core package connects to a remote browser; no local Chromium download is needed for this example.

    Shell
    npm install adscrawl puppeteer-core
  2. Set the API key

    Set ADSCRAWL_API_KEY in the environment of the process running your client. Keep it out of browser code and source control.

  3. Connect, read and clean up

    Run as a Node.js ES module. The example reads the page title and uses finally to request session closure even if navigation fails.

    JavaScript
    import puppeteer from 'puppeteer-core';
    import AdsCrawl from 'adscrawl';
    
    const client = new AdsCrawl();
    const session = await client.cdp.create();
    try {
      const version = await client.cdp.getVersion(session);
      const browser = await puppeteer.connect({
        browserWSEndpoint: version.webSocketDebuggerUrl,
      });
      try {
        const pages = await browser.pages();
        const page = pages[0] ?? await browser.newPage();
        await page.goto('https://example.com');
        console.log(await page.title());
      } finally {
        browser.disconnect();
      }
    } finally {
      await client.cdp.close(session.sessionId);
    }

Usage & limits

  • Remote CDP connects to Chromium. This is not a Firefox or WebKit endpoint, and Playwright's CDP connection differs from its native Playwright protocol.
  • API requests and browser sessions use your AdsCrawl account credits. Installing a client does not include a separate usage allowance.
  • Close remote sessions after use. A disconnected client or closed viewer does not confirm that the server-side session has stopped.
See pricing and credit conversion

Further reading

JavaScript SDK and CDP examplesRemote CDP concepts