'Is there a different way to "click" on elements with puppeteer? I am being detected with the normal page.click

I am using the Puppeteer Stealth Plugin and can do all clicks on a website without being detected except one where I put an article into the cart. On this button I am sometimes detected sadly. Its about every second time but I need the bot to always work.

Is there a different way to click on an element then use the page.click operation? I was able to click on the button in selenium undetected-chromedriver (it has issues elsewhere thus I cant use it) but not puppeteer. The click goes through but the arcticle is not in the cart and the site says "your client has been blocked by bot protection".

Thank you for your ideas for different ways to click that are not detectable!

while(true){
      try {
        await page.waitForTimeout(200)
        await page.waitForSelector('.nbb-btn.btn_full.js-pdp-head-add-to-cart:not([disabled])', {timeout: ((Math.floor(Math.random() * 12) + 5) * 200)})
        page.click('.nbb-btn.btn_full.js-pdp-head-add-to-cart:not([disabled])')
        
        break
      }


Solution 1:[1]

I recently ran into something similar (although the error message didn't explicitly mention that puppeteer was a detected bot).

I tried adding page.waitForTimeout() calls to try and emulate a more human-like page navigation with no success.

I eventually found this puppeteer package ghost-cursor that simulates human-like mouse movements.

I just followed the readme instructions to create a cursor for the page and then used await cursor.click(#signUp-button) (or whatever element you want to click).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zaccheus