question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

requestInterception enabled causes puppeteer to be detected as bot

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 2.0.0
  • Platform / OS version: MacOS 10.14.5
  • URLs (if applicable):
  • Node.js version: v10.8.0

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Running puppeteer with headless: false on a url with PerimeterX protection seems to work fine
  2. Enabling setRequestInterception causes puppeteer to go to captcha page because page is detecting it as bot. No matter what file type i’m intercepting, or even continuing every request, it will lead to captcha page.
  3. Disabling it will get html without problems.

This is my code to test request interception

await page.setRequestInterception(true);
page.on('request', (request) => {
 request.continue();
});

Also tried this code with same result

await page.setRequestInterception(true);
  page.on('request', request => {
    if (request.resourceType() === 'image')
      request.abort();
    else
      request.continue();
  });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ordimanscommented, May 27, 2020

I have built a wrapper/framework on top of puppeteer to solve these kinds of issues: https://nicoandmee.github.io/puppeteer-theater/ check it out if interested.

Your linked was removed. Do you have a trick to avoid this ?

0reactions
stale[bot]commented, Jul 26, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid being detected as bot on Puppeteer and ...
So I guess Puppeteer/PhantomJS both are not catching cookies, because this site is denying the headless browser access. What could I do for ......
Read more >
Request Interception - Puppeteer
Request Interception. Once request interception is enabled, every request will stall unless it's continued, responded or aborted. An example of a naïve request...
Read more >
puppeteer-extra-plugin-stealth - npm package - Snyk
This plugin uses puppeteer-extra 's dependency system to only require code mods for evasions that have been enabled, to keep things modular and...
Read more >
Web Scraping with JavaScript and NodeJS - ScrapingBee
Learn web scraping with JavaScript and NodeJS with this step-by-step tutorial. We will see the different ways to scrape the web in ...
Read more >
Devtools Service - WebdriverIO
... and call Chrome DevTools commands within your tests to e.g. intercept requests, ... Enables auto performance audits for all page loads that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found