All systems operational HTTP · HTTPS · SOCKS5 Global network
Documentation home Quickstart Engineering guides Code examples Global network Pricing Solutions overview Custom proxy pools Managed data scraping Contact Console
CODE EXAMPLE

Run Puppeteer through authenticated rotating proxies.

Run Puppeteer through authenticated rotating proxies. This example uses Rotating Proxies as the default gateway and can be adapted by replacing endpoint and routing credentials.

LanguageNode.js 20+FrameworkPuppeteerGatewayRotating ProxiesFilebrowser.mjs
01
SETUP

Install the client and create a file.

Use a clean project environment and pin tested dependency versions for production. The example target is a public scraping sandbox.

Installnpm install puppeteer
02
CREDENTIALS

Load proxy secrets from the environment.

The proxy username is not the LundProxy website login. Copy the complete username and password generated for the selected proxy product.

PROXY_USER=user-pool-crawlerPROXY_PASS=your-secret
03
COMPLETE EXAMPLE

browser.mjs

Copy the code into the named file, set credentials, and run it from the project environment.

import puppeteer from "puppeteer";

const browser = await puppeteer.launch({
  headless: true,
  args: ["--proxy-server=http://proxy.lundproxy.com:36923"],
});

try {
  const page = await browser.newPage();
  await page.authenticate({
    username: process.env.PROXY_USER,
    password: process.env.PROXY_PASS,
  });
  await page.goto("https://quotes.toscrape.com/js/", {
    waitUntil: "domcontentloaded",
    timeout: 30_000,
  });
  console.log(await page.$$eval(".quote", nodes => nodes.length));
} finally {
  await browser.close();
}
04
WHAT THE EXAMPLE DOES

Keep the important behavior visible.

01Gateway and credentials use separate APIs.
02Navigation has a hard timeout.
03Browser cleanup is in finally.
04Limit simultaneous pages by measured request load.
05
PRODUCTION NOTES

Add workload-specific controls before scale.

A successful sandbox run proves integration, not production readiness.

Test representative targets, response sizes, routing policy, concurrency, retries, validation, and completion window. Collect only public data you are authorized to access.

06
EXAMPLE FAQ

Puppeteer questions.

Does each page use a different exit?

That depends on the product and SESSION policy, not the number of Puppeteer pages.

Can I authenticate after navigation?

Authenticate before the first proxied navigation.

How should I reduce traffic?

Block only resources that are not required by the page behavior you need.