Eliminate Blocks in Web Scraping with Puppeteer Stealth

Nathan Reynolds

Last edited on May 4, 2025
Last edited on May 4, 2025

Bypass Methods

Evading Detection: Using Puppeteer Stealth for Smoother Web Scraping

Puppeteer, a powerful Node.js library for controlling Chrome or Chromium browsers, is a go-to tool for automating browser tasks. It’s particularly handy for web scraping scenarios where rendering JavaScript or interacting with complex pages is necessary.

While automating a real browser often sidesteps basic anti-bot measures more effectively than simple HTTP requests, sophisticated detection systems can still flag automated sessions. This is where add-ons like the Puppeteer Stealth plugin come into play, aiming to make automated browsers appear more human and significantly reduce the chance of getting blocked.

Getting Acquainted with Puppeteer Extra

Puppeteer Extra acts as a wrapper around the standard Puppeteer library, enhancing it with a plugin system. This allows developers to easily add functionalities. The most celebrated plugin is undoubtedly Stealth, but Puppeteer Extra offers others too, like an adblocker plugin which can help cut down on bandwidth usage – a relevant factor when utilizing proxies charged by data consumption.

However, the Stealth plugin remains the star. For many web scraping projects, it's almost indispensable because it tackles numerous browser characteristics that anti-bot systems scrutinize. The developers claim it can bypass common public bot detectors, drastically improving scraping success rates.

It's important to maintain realistic expectations, though. Puppeteer Stealth isn't a magic bullet. Websites employing advanced or custom-built detection mechanisms might still identify and block automated traffic. Therefore, a multi-layered approach, often involving reliable proxies and careful configuration, remains essential for robust scraping operations.

Decoding Puppeteer Stealth: How Does It Work?

At its core, Puppeteer Stealth modifies the digital fingerprint of the browser instance controlled by Puppeteer to blend in better with typical user traffic. It achieves this through several clever adjustments under the hood:

  • Restoring Missing Browser Features: Headless browsers sometimes lack certain properties or behaviours found in regular browsers (like specific ways fonts, media codecs, or permissions are handled). Stealth patches these discrepancies.

  • User Agent Consistency: Automated browsers often reveal themselves through their default user agent string. Stealth replaces this with common, up-to-date user agents used by everyday browsers.

  • Masking the navigator.webdriver Flag: This JavaScript property is a classic giveaway, explicitly indicating automated control. Stealth modifies this property to hide the browser's automated nature.

  • Simulating Plugins and Refining Fingerprints: Real users rarely browse with a completely vanilla browser. Their setups include various plugins and specific configurations that contribute to their unique fingerprint. Stealth mimics the presence of common plugins and tweaks other fingerprinting vectors (like WebGL parameters or canvas rendering) to appear less robotic.

  • Humanizing Interactions: The way automated scripts click buttons, fill forms, or even move the mouse can differ subtly from human behaviour. Stealth applies techniques to make these interactions seem more natural, addressing behavioural analysis detection methods.

Implementing these evasion techniques via Puppeteer Stealth can significantly decrease the block rate encountered during web scraping tasks. Unless you've engineered your own sophisticated anti-detection measures, using Puppeteer Stealth is highly recommended.

Implementing Puppeteer Stealth in Your Scraper

Ready to give it a try? First, ensure you have Node.js installed on your system and a code editor (like VS Code, Sublime Text, etc.) set up for Node.js development.

Open your project directory in your terminal or integrated console and install the necessary packages using npm:

npm

Next, add the Stealth plugin itself:

npm

With the packages installed, you can now incorporate Puppeteer Stealth into your Node.js script. Here’s a basic setup:

// Import puppeteer-extra
const puppeteer = require('puppeteer-extra');

// Import the stealth plugin
const StealthPlugin = require('puppeteer-extra-plugin-stealth');

// Tell puppeteer to use the stealth plugin
puppeteer.use(StealthPlugin());

// Standard Puppeteer launch code, but using the 'puppeteer' variable configured with Stealth
puppeteer.launch({ headless: true })
  .then(async browser => {
    console.log('Running browser in stealth mode..');
    const page = await browser.newPage();

    // Let's navigate to Evomi's fingerprint checker to see what it detects
    await page.goto('https://check.evomi.com/', { waitUntil: 'domcontentloaded' });

    await page.screenshot({ path: 'stealth-check.png', fullPage: true }); // Optional: take a screenshot

    console.log('Page loaded. Closing browser.');
    await browser.close();
  });

This script initializes Puppeteer Extra, enables the Stealth plugin, launches a headless browser, navigates to a target page (we're using Evomi's fingerprint checker as an example), and then closes the browser. The key is that the `puppeteer` object we use is now enhanced with stealth capabilities.

Integrating proxies is also crucial for many scraping tasks. A straightforward way to add a proxy with Puppeteer is via launch arguments. For example, to use one of Evomi's residential proxies:

puppeteer.launch({
  headless: true,
  args: [
    '--proxy-server=http://rp.evomi.com:1000' // Replace with your specific proxy address/port
    // You might need authentication depending on the proxy setup:
    // '--proxy-auth=username:password' // Generally handled via proxy headers or specific plugins
  ]
}).then(async browser => {
  // ... your scraping logic
  // Consider using Evomi's free trial to test residential proxies!
  const page = await browser.newPage();
  // For authenticated proxies, you often need to handle it like this:
  // await page.authenticate({ username: 'YOUR_USERNAME', password: 'YOUR_PASSWORD' });
  await page.goto('https://geo.evomi.com/'); // Check perceived location via proxy
  console.log('Current IP Info Page Loaded via Proxy');
  await page.screenshot({ path: 'proxy-check.png' });
  await browser.close();
});

Remember to replace http://rp.evomi.com:1000 with your actual proxy endpoint and port. For authenticated proxies (like username/password), you'll typically use the page.authenticate() method after creating the page, or integrate specific proxy management plugins available for Puppeteer Extra. Trying this out is easy, especially since Evomi offers a free trial for residential, mobile, and datacenter proxies.

When Puppeteer Stealth Isn't Enough: Exploring Alternatives

If you find that Puppeteer Stealth still triggers anti-bot systems on certain challenging websites, don't despair. Several other robust browser automation frameworks exist, some with their own built-in or community-driven stealth features:

  • Playwright: Developed by Microsoft, Playwright is a strong competitor to Puppeteer, also supporting Node.js (as well as Python, Java, and .NET). It offers similar capabilities and has its own methods for mitigating detection.

  • Selenium: A long-standing standard in browser automation, primarily used with Python but offering bindings for other languages. The Selenium ecosystem is vast, including various tools like undetected-chromedriver designed to enhance stealth.

  • Cypress: While primarily known as a front-end testing framework, Cypress can also be employed for certain web scraping tasks involving browser automation. It operates differently from Puppeteer/Playwright, which might bypass some detection methods.

Keep in mind that even the most advanced frameworks and stealth plugins can't guarantee immunity from blocks or CAPTCHAs. The objective is always to minimize these interruptions, not eliminate them entirely. This is why combining capable automation tools with high-quality, ethically sourced proxies (like residential or mobile proxies) is fundamental for consistent and successful web scraping at scale.

Evading Detection: Using Puppeteer Stealth for Smoother Web Scraping

Puppeteer, a powerful Node.js library for controlling Chrome or Chromium browsers, is a go-to tool for automating browser tasks. It’s particularly handy for web scraping scenarios where rendering JavaScript or interacting with complex pages is necessary.

While automating a real browser often sidesteps basic anti-bot measures more effectively than simple HTTP requests, sophisticated detection systems can still flag automated sessions. This is where add-ons like the Puppeteer Stealth plugin come into play, aiming to make automated browsers appear more human and significantly reduce the chance of getting blocked.

Getting Acquainted with Puppeteer Extra

Puppeteer Extra acts as a wrapper around the standard Puppeteer library, enhancing it with a plugin system. This allows developers to easily add functionalities. The most celebrated plugin is undoubtedly Stealth, but Puppeteer Extra offers others too, like an adblocker plugin which can help cut down on bandwidth usage – a relevant factor when utilizing proxies charged by data consumption.

However, the Stealth plugin remains the star. For many web scraping projects, it's almost indispensable because it tackles numerous browser characteristics that anti-bot systems scrutinize. The developers claim it can bypass common public bot detectors, drastically improving scraping success rates.

It's important to maintain realistic expectations, though. Puppeteer Stealth isn't a magic bullet. Websites employing advanced or custom-built detection mechanisms might still identify and block automated traffic. Therefore, a multi-layered approach, often involving reliable proxies and careful configuration, remains essential for robust scraping operations.

Decoding Puppeteer Stealth: How Does It Work?

At its core, Puppeteer Stealth modifies the digital fingerprint of the browser instance controlled by Puppeteer to blend in better with typical user traffic. It achieves this through several clever adjustments under the hood:

  • Restoring Missing Browser Features: Headless browsers sometimes lack certain properties or behaviours found in regular browsers (like specific ways fonts, media codecs, or permissions are handled). Stealth patches these discrepancies.

  • User Agent Consistency: Automated browsers often reveal themselves through their default user agent string. Stealth replaces this with common, up-to-date user agents used by everyday browsers.

  • Masking the navigator.webdriver Flag: This JavaScript property is a classic giveaway, explicitly indicating automated control. Stealth modifies this property to hide the browser's automated nature.

  • Simulating Plugins and Refining Fingerprints: Real users rarely browse with a completely vanilla browser. Their setups include various plugins and specific configurations that contribute to their unique fingerprint. Stealth mimics the presence of common plugins and tweaks other fingerprinting vectors (like WebGL parameters or canvas rendering) to appear less robotic.

  • Humanizing Interactions: The way automated scripts click buttons, fill forms, or even move the mouse can differ subtly from human behaviour. Stealth applies techniques to make these interactions seem more natural, addressing behavioural analysis detection methods.

Implementing these evasion techniques via Puppeteer Stealth can significantly decrease the block rate encountered during web scraping tasks. Unless you've engineered your own sophisticated anti-detection measures, using Puppeteer Stealth is highly recommended.

Implementing Puppeteer Stealth in Your Scraper

Ready to give it a try? First, ensure you have Node.js installed on your system and a code editor (like VS Code, Sublime Text, etc.) set up for Node.js development.

Open your project directory in your terminal or integrated console and install the necessary packages using npm:

npm

Next, add the Stealth plugin itself:

npm

With the packages installed, you can now incorporate Puppeteer Stealth into your Node.js script. Here’s a basic setup:

// Import puppeteer-extra
const puppeteer = require('puppeteer-extra');

// Import the stealth plugin
const StealthPlugin = require('puppeteer-extra-plugin-stealth');

// Tell puppeteer to use the stealth plugin
puppeteer.use(StealthPlugin());

// Standard Puppeteer launch code, but using the 'puppeteer' variable configured with Stealth
puppeteer.launch({ headless: true })
  .then(async browser => {
    console.log('Running browser in stealth mode..');
    const page = await browser.newPage();

    // Let's navigate to Evomi's fingerprint checker to see what it detects
    await page.goto('https://check.evomi.com/', { waitUntil: 'domcontentloaded' });

    await page.screenshot({ path: 'stealth-check.png', fullPage: true }); // Optional: take a screenshot

    console.log('Page loaded. Closing browser.');
    await browser.close();
  });

This script initializes Puppeteer Extra, enables the Stealth plugin, launches a headless browser, navigates to a target page (we're using Evomi's fingerprint checker as an example), and then closes the browser. The key is that the `puppeteer` object we use is now enhanced with stealth capabilities.

Integrating proxies is also crucial for many scraping tasks. A straightforward way to add a proxy with Puppeteer is via launch arguments. For example, to use one of Evomi's residential proxies:

puppeteer.launch({
  headless: true,
  args: [
    '--proxy-server=http://rp.evomi.com:1000' // Replace with your specific proxy address/port
    // You might need authentication depending on the proxy setup:
    // '--proxy-auth=username:password' // Generally handled via proxy headers or specific plugins
  ]
}).then(async browser => {
  // ... your scraping logic
  // Consider using Evomi's free trial to test residential proxies!
  const page = await browser.newPage();
  // For authenticated proxies, you often need to handle it like this:
  // await page.authenticate({ username: 'YOUR_USERNAME', password: 'YOUR_PASSWORD' });
  await page.goto('https://geo.evomi.com/'); // Check perceived location via proxy
  console.log('Current IP Info Page Loaded via Proxy');
  await page.screenshot({ path: 'proxy-check.png' });
  await browser.close();
});

Remember to replace http://rp.evomi.com:1000 with your actual proxy endpoint and port. For authenticated proxies (like username/password), you'll typically use the page.authenticate() method after creating the page, or integrate specific proxy management plugins available for Puppeteer Extra. Trying this out is easy, especially since Evomi offers a free trial for residential, mobile, and datacenter proxies.

When Puppeteer Stealth Isn't Enough: Exploring Alternatives

If you find that Puppeteer Stealth still triggers anti-bot systems on certain challenging websites, don't despair. Several other robust browser automation frameworks exist, some with their own built-in or community-driven stealth features:

  • Playwright: Developed by Microsoft, Playwright is a strong competitor to Puppeteer, also supporting Node.js (as well as Python, Java, and .NET). It offers similar capabilities and has its own methods for mitigating detection.

  • Selenium: A long-standing standard in browser automation, primarily used with Python but offering bindings for other languages. The Selenium ecosystem is vast, including various tools like undetected-chromedriver designed to enhance stealth.

  • Cypress: While primarily known as a front-end testing framework, Cypress can also be employed for certain web scraping tasks involving browser automation. It operates differently from Puppeteer/Playwright, which might bypass some detection methods.

Keep in mind that even the most advanced frameworks and stealth plugins can't guarantee immunity from blocks or CAPTCHAs. The objective is always to minimize these interruptions, not eliminate them entirely. This is why combining capable automation tools with high-quality, ethically sourced proxies (like residential or mobile proxies) is fundamental for consistent and successful web scraping at scale.

Evading Detection: Using Puppeteer Stealth for Smoother Web Scraping

Puppeteer, a powerful Node.js library for controlling Chrome or Chromium browsers, is a go-to tool for automating browser tasks. It’s particularly handy for web scraping scenarios where rendering JavaScript or interacting with complex pages is necessary.

While automating a real browser often sidesteps basic anti-bot measures more effectively than simple HTTP requests, sophisticated detection systems can still flag automated sessions. This is where add-ons like the Puppeteer Stealth plugin come into play, aiming to make automated browsers appear more human and significantly reduce the chance of getting blocked.

Getting Acquainted with Puppeteer Extra

Puppeteer Extra acts as a wrapper around the standard Puppeteer library, enhancing it with a plugin system. This allows developers to easily add functionalities. The most celebrated plugin is undoubtedly Stealth, but Puppeteer Extra offers others too, like an adblocker plugin which can help cut down on bandwidth usage – a relevant factor when utilizing proxies charged by data consumption.

However, the Stealth plugin remains the star. For many web scraping projects, it's almost indispensable because it tackles numerous browser characteristics that anti-bot systems scrutinize. The developers claim it can bypass common public bot detectors, drastically improving scraping success rates.

It's important to maintain realistic expectations, though. Puppeteer Stealth isn't a magic bullet. Websites employing advanced or custom-built detection mechanisms might still identify and block automated traffic. Therefore, a multi-layered approach, often involving reliable proxies and careful configuration, remains essential for robust scraping operations.

Decoding Puppeteer Stealth: How Does It Work?

At its core, Puppeteer Stealth modifies the digital fingerprint of the browser instance controlled by Puppeteer to blend in better with typical user traffic. It achieves this through several clever adjustments under the hood:

  • Restoring Missing Browser Features: Headless browsers sometimes lack certain properties or behaviours found in regular browsers (like specific ways fonts, media codecs, or permissions are handled). Stealth patches these discrepancies.

  • User Agent Consistency: Automated browsers often reveal themselves through their default user agent string. Stealth replaces this with common, up-to-date user agents used by everyday browsers.

  • Masking the navigator.webdriver Flag: This JavaScript property is a classic giveaway, explicitly indicating automated control. Stealth modifies this property to hide the browser's automated nature.

  • Simulating Plugins and Refining Fingerprints: Real users rarely browse with a completely vanilla browser. Their setups include various plugins and specific configurations that contribute to their unique fingerprint. Stealth mimics the presence of common plugins and tweaks other fingerprinting vectors (like WebGL parameters or canvas rendering) to appear less robotic.

  • Humanizing Interactions: The way automated scripts click buttons, fill forms, or even move the mouse can differ subtly from human behaviour. Stealth applies techniques to make these interactions seem more natural, addressing behavioural analysis detection methods.

Implementing these evasion techniques via Puppeteer Stealth can significantly decrease the block rate encountered during web scraping tasks. Unless you've engineered your own sophisticated anti-detection measures, using Puppeteer Stealth is highly recommended.

Implementing Puppeteer Stealth in Your Scraper

Ready to give it a try? First, ensure you have Node.js installed on your system and a code editor (like VS Code, Sublime Text, etc.) set up for Node.js development.

Open your project directory in your terminal or integrated console and install the necessary packages using npm:

npm

Next, add the Stealth plugin itself:

npm

With the packages installed, you can now incorporate Puppeteer Stealth into your Node.js script. Here’s a basic setup:

// Import puppeteer-extra
const puppeteer = require('puppeteer-extra');

// Import the stealth plugin
const StealthPlugin = require('puppeteer-extra-plugin-stealth');

// Tell puppeteer to use the stealth plugin
puppeteer.use(StealthPlugin());

// Standard Puppeteer launch code, but using the 'puppeteer' variable configured with Stealth
puppeteer.launch({ headless: true })
  .then(async browser => {
    console.log('Running browser in stealth mode..');
    const page = await browser.newPage();

    // Let's navigate to Evomi's fingerprint checker to see what it detects
    await page.goto('https://check.evomi.com/', { waitUntil: 'domcontentloaded' });

    await page.screenshot({ path: 'stealth-check.png', fullPage: true }); // Optional: take a screenshot

    console.log('Page loaded. Closing browser.');
    await browser.close();
  });

This script initializes Puppeteer Extra, enables the Stealth plugin, launches a headless browser, navigates to a target page (we're using Evomi's fingerprint checker as an example), and then closes the browser. The key is that the `puppeteer` object we use is now enhanced with stealth capabilities.

Integrating proxies is also crucial for many scraping tasks. A straightforward way to add a proxy with Puppeteer is via launch arguments. For example, to use one of Evomi's residential proxies:

puppeteer.launch({
  headless: true,
  args: [
    '--proxy-server=http://rp.evomi.com:1000' // Replace with your specific proxy address/port
    // You might need authentication depending on the proxy setup:
    // '--proxy-auth=username:password' // Generally handled via proxy headers or specific plugins
  ]
}).then(async browser => {
  // ... your scraping logic
  // Consider using Evomi's free trial to test residential proxies!
  const page = await browser.newPage();
  // For authenticated proxies, you often need to handle it like this:
  // await page.authenticate({ username: 'YOUR_USERNAME', password: 'YOUR_PASSWORD' });
  await page.goto('https://geo.evomi.com/'); // Check perceived location via proxy
  console.log('Current IP Info Page Loaded via Proxy');
  await page.screenshot({ path: 'proxy-check.png' });
  await browser.close();
});

Remember to replace http://rp.evomi.com:1000 with your actual proxy endpoint and port. For authenticated proxies (like username/password), you'll typically use the page.authenticate() method after creating the page, or integrate specific proxy management plugins available for Puppeteer Extra. Trying this out is easy, especially since Evomi offers a free trial for residential, mobile, and datacenter proxies.

When Puppeteer Stealth Isn't Enough: Exploring Alternatives

If you find that Puppeteer Stealth still triggers anti-bot systems on certain challenging websites, don't despair. Several other robust browser automation frameworks exist, some with their own built-in or community-driven stealth features:

  • Playwright: Developed by Microsoft, Playwright is a strong competitor to Puppeteer, also supporting Node.js (as well as Python, Java, and .NET). It offers similar capabilities and has its own methods for mitigating detection.

  • Selenium: A long-standing standard in browser automation, primarily used with Python but offering bindings for other languages. The Selenium ecosystem is vast, including various tools like undetected-chromedriver designed to enhance stealth.

  • Cypress: While primarily known as a front-end testing framework, Cypress can also be employed for certain web scraping tasks involving browser automation. It operates differently from Puppeteer/Playwright, which might bypass some detection methods.

Keep in mind that even the most advanced frameworks and stealth plugins can't guarantee immunity from blocks or CAPTCHAs. The objective is always to minimize these interruptions, not eliminate them entirely. This is why combining capable automation tools with high-quality, ethically sourced proxies (like residential or mobile proxies) is fundamental for consistent and successful web scraping at scale.

Author

Nathan Reynolds

Web Scraping & Automation Specialist

About Author

Nathan specializes in web scraping techniques, automation tools, and data-driven decision-making. He helps businesses extract valuable insights from the web using ethical and efficient scraping methods powered by advanced proxies. His expertise covers overcoming anti-bot mechanisms, optimizing proxy rotation, and ensuring compliance with data privacy regulations.

Like this article? Share it.
You asked, we answer - Users questions:
Does using the Puppeteer Stealth plugin significantly slow down web scraping performance?+
Is Puppeteer Stealth more effective if I run Puppeteer in headful mode instead of headless mode?+
How effective is Puppeteer Stealth against advanced bot detection systems like Cloudflare Bot Management or Akamai?+
How often should I update the Puppeteer Stealth plugin and Puppeteer Extra?+
Can I use Puppeteer Stealth alongside other Puppeteer Extra plugins, such as an ad blocker or a CAPTCHA solver plugin?+

In This Article

Read More Blogs