- Proxies
- Integrations
- Proxies for Puppeteer
Proxies for Puppeteer
Puppeteer is a Node.js library that provides a high-level API for controlling headless or full browsers like Google Chrome or Chromium
What is Puppeteer?
Puppeteer is a Node.js library that offers a high-level API for controlling headless or full browsers like Google Chrome or Chromium. It enables web automation, scraping, testing, and performance monitoring. With Puppeteer, you can simulate user actions, extract data, and generate PDFs or screenshots.
How to set up?
Before proceeding, check if Node.js is installed by opening a terminal (Command Prompt or shell) and typing the following command:
node -v
This will display the installed version of Node.js, if it is installed.
In this case, proceed to next step: Create a project directory.
If Node.js is not installed on your system, you will see this error:
'node' is not recognized as an internal or external command
If this is the case, continue with the steps below:
Download Node.js
– Visit the official Node.js website.
– Download the LTS (Long Term Support) version for your operating system.
Install Node.js:
– Run the installer you downloaded.
– Follow the steps in the installation wizard.
Create a project directory:
- Open a terminal and create a directory for your project:
mkdir puppeteer-nodemaven-proxy
Go to the directory:
- Navigate to the project directory:
cd puppeteer-nodemaven-proxy
Initialize the project:
- Initialize the project with default settings:
npm init -y
Note:
Running thenpm init -y
command will create apackage.json
file in your project directory, which includes the basic metadata for your Node.js project.
Install Puppeteer with:
npm install puppeteer
Set up Puppeteer with a NodeMaven Proxy:
- In your project directory, create a new file named
index.js
using your preferred text editor. - Add the following code to
index.js
:
const puppeteer = require('puppeteer');
(async () => {
// Launch Puppeteer with a proxy
const browser = await puppeteer.launch({
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--proxy-server=http://gate.nodemaven.com:8080'
],
});
const page = await browser.newPage();
// Authenticate with the proxy
await page.authenticate({
username: 'REPLACE THIS WITH YOUR NODEMAVEN PROXY USERNAME',
password: 'REPLACE THIS WITH YOUR NODEMAVEN PROXY PASSWORD'
});
try {
// Navigate to a website
await page.goto('https://nodemaven.com/');
console.log('Page title:', await page.title());
} catch (err) {
console.error('Error navigating to the page:', err);
} finally {
// Close the browser
await browser.close();
}
})();
For Whitelisted IP authentication
const puppeteer = require('puppeteer');
(async () => {
// Launch Puppeteer in headless mode with a proxy
const browser = await puppeteer.launch({
headless: true, // Default is true, so no visible browser
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--proxy-server=http://gate.nodemaven.com:8405' // Replace with your IP whitelisting proxy
],
});
const page = await browser.newPage();
try {
// Navigate to the website
await page.goto('https://nodemaven.com/');
// Get the page title
const title = await page.title();
console.log('Page title:', title);
} catch (err) {
console.error('Error navigating to the page:', err);
} finally {
// Close the browser
await browser.close();
}
})();
Run the Script
Use the following command in the terminal:
node index.js
Expected Output:
If everything is set up correctly, the script should log the title of the page (https://nodemaven.com
) to the console.
Now you are ready to personalize your script and start using Puppeteer with NodeMaven proxies!
Still have questions?
Other Residential Proxy Integrations
Selenium
Puppeteer
Playwright
Multilogin
Morelogin
Gologin
AdsPower
Dolphin Anty
Top Residential Proxy Locations
Main Features
IP Quality Filter
Achieve 95% High-Quality Connections with Reliable, Clean Proxy IPs
Automatıc ıp rotatıon
Flexible IP rotation per request or session
Traffic Roll-Over
Carry Forward Unused Proxy Traffic
24-Hour Sticky Sessions
Maintain a Consistent IP for Up to 24 Hours for Stable Sessions
Custom Proxy Configuration
Get a Proxy Setup Tailored to Your Website and Unique Business Needs
30+ Million Residential IP Pool
Leverage a Premium Network of 30 Million+ High-Quality Residential IPs
Geo and ISP Targeting
Access IPs Across 150+ Countries and Major ISPs
Frequently Asked Questions
How do I set up Puppeteer with NodeMaven proxies?
Install Node.js, create a project, and install Puppeteer. Then, configure Puppeteer to use NodeMaven proxies by adding the proxy server and authentication details (username/password or IP whitelisting) in your script. Run the script with node index.js
.
What authentication methods does NodeMaven support for Puppeteer?
NodeMaven supports two authentication methods: Username/Password (use your credentials in the script) and IP Whitelisting (no credentials needed if your IP is pre-approved).
How do I troubleshoot issues with Puppeteer and NodeMaven proxies?
Check if the proxy server URL and port are correct, verify credentials (for username/password auth), and ensure your IP is whitelisted (for IP auth). Also, try running Puppeteer in non-headless mode to debug page loading issues.