Integrating with Puppeteer
How to use Puppeteer with Airtop
Puppeteer is a popular automation library for Node.js that allows you to control headless browsers. Airtop provides a Puppeteer connector that allows you to use Puppeteer to automate your browser.
Puppeteer is not supported in Python. We recommend using Playwright or Selenium instead.
Installation
You will need to install the puppeteer-core
package to use Puppeteer with Airtop.
Usage
Once you have created a session with Airtop, you can use the puppeteer-core
package to control the browser by connecting Puppeteer to the CDP endpoint provided by Airtop.
If you’re not already familiar with Puppeteer, you might want to check out their documentation to learn more about the library and its capabilities.
Combining Puppeteer and Airtop Window Management
You can use Airtop’s window management functions in combination with Puppeteer to automate your browser. For example, you might want to create a new window, load a URL in it, use our AI APIs, but use Puppeteer to push a few buttons on the page.
Once you create a window, you’ll be given a window ID, which you’ll use to interact with the window using Airtop’s SDK. But you’ll also be given a targetId
, which you’ll use to connect Puppeteer to the window.
Common Errors
Here are some common errors you might encounter when using Puppeteer with Airtop when you initially connect to the CDP endpoint: