Skip to main content
Puppeteer with NodeJS

How to configure Proxyrack proxies with Puppeteer

K
Written by Katy
Updated over a month ago

Puppeteer is a headless browser package for NodeJS. You can find more information here. Use the code sample below to get started with integrating Proxyrack proxies into Puppeteer:

const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: [
'--proxy-server=http://private.residential.proxyrack.net:10000'
// this is the DNS for Private Unmetered Residential proxies. You can substitute the DNS for the specific service you are using
]
});
const page = await browser.newPage();
await page.authenticate({
username: '{{username goes here}}',
password: '{{ api key goes here }}',
});
await page.goto('https://www.google.com', {waitUntil: 'networkidle0'});
let bodyHTML = await page.evaluate(() => document.body.innerHTML);
console.log(bodyHTML)
await browser.close();
})();

Did this answer your question?