Skip to main content

How to connect to ScrapingAnt proxy via Puppeteer?

Introduction

The documentation below describes how to use ScrapingAnt service with Puppeteer. Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.

ScrapingAnt services are compatible with many software platforms and tools, from operating systems to browser add-ons. Explore our step-by-step integration guides and learn how to set up your proxies.

HTTPS Proxy support

ScrapingAnt supports HTTPS proxy protocol (HTTP proxy with CONNECT method), still, Puppeteer does not support HTTPS proxy protocol. To use ScrapingAnt with Puppeteer, you need to use HTTP proxy protocol.

Setup example

const puppeteer = require('puppeteer');

(async () => {
const browser = await puppeteer.launch({
args: ['--proxy-server=residential.scrapingant.com:8080']
});

const page = await browser.newPage();

await page.authenticate({
username: '<YOUR_USERNAME>',
password: '<YOUR_PASSWORD>'
});

await page.goto('https://httpbin.org/ip');

// Perform your actions here

await browser.close();
})();