3

I want to detect if a client visiting a website is using puppeteer instead of being a real user.

Does puppeteer add a request header that tells that the request is coming from puppeteer?

Edit:

Imagine I created a website. I want to block users using puppeteer because I want my users to be "real" users (person that clicks a button, not a script imitating a button click). I want to know if there is anything specific I could check (headers?) that would identify him as being puppeteer and not a real human so I could ignore his requests (i.e. not save anything in database, redirect to error page or other things)

Another Edit:

As @root pointed out, I could detect in browser if a user agent is controlled by automation (like Puppeteer). Although this is not what was on my mind first (I want to detect headers so I would ignore/block processing in server side and be able to log then to pinpoint users who use automation), I would accept it as the answer if no other alternative is present.

mortillan
  • 43
  • 6
  • 2
    Even if it does, it is also customisable, so your "filter" might not be accurate afterall. What is that you are trying to achieve? – Adriano May 06 '19 at 02:18
  • Please define what you are trying to do. If you're trying to block puppeteer, I think you are going to face a lot of issues and get a lot of false positives. – zero298 May 06 '19 at 02:29
  • @zero298 - I updated my question. Hope it's much clearer now. – mortillan May 06 '19 at 04:23
  • @Adriano - I am still at research part, whether it is feasible or not. It doesn't matter if it is not doable so long as I could justify it to the client. Kindly see my updated question. Thanks! – mortillan May 06 '19 at 04:24
  • Check out the link to the duplicate I posted. This might be what you are looking for. – Thomas Dondorf May 06 '19 at 05:20

1 Answers1

1

If you mean "a client visiting MY website" and "using a webdriver instead of being a real user", you can add a JavaScript snippet to your site that checks navigator.webdriver and if it's true, then the site behaves differently.

root
  • 5,528
  • 1
  • 7
  • 15
  • Wow did not know about this. This is very useful. I'll mark this as an alternative if there is no way to detect in server side if request is from Puppeteer. – mortillan May 06 '19 at 04:35