undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

Avoiding Detection using Actions

Open noodleman420 opened this issue 2 years ago • 5 comments

It appears that the actions that I make is detected. For example, navigating to an element and clicking on it.

    ActionChains(driver)\
        .scroll_to_element(element)\
        .move_to_element_with_offset(element, random.uniform(5, 10), random.uniform(5, 10))\
        .pause(random.uniform(0.1, 0.3))\
        .click()\
        .perform()

Is there a better way to make actions like these? It is undetected when I use my mouse manually clicking (or using pyautogui), however once I use an Action, it is detected.

I have added pauses, and hovering / moving to offset, however it does not seem to work.

noodleman420 avatar Jun 14 '22 01:06 noodleman420

You're right sites are getting better at detecting non human reaction time, instant keystrokes, mouse not travelling, etc... Please check here for some "enhanced" actions I added to handle some of those issues.

sebdelsol avatar Jun 14 '22 10:06 sebdelsol

Thank you @sebdelsol, appreciate it. Do you have any other tips for mouse clicks using Actions?

noodleman420 avatar Jun 14 '22 18:06 noodleman420

It depends a lot on the targeted site... I've stumbled upon on some that were sensible to too fast reaction or too fast keystrokes, other that timed their sliders, other that expected the mouse to travel through the page before a click... When it doesn't work, rely on common sense : what would an actual human do ?

sebdelsol avatar Jun 14 '22 22:06 sebdelsol

@noodleman420 Have you found any solution so far for mouse movement other than pyautogui?

xploader avatar Jul 11 '22 00:07 xploader

@xploader Nope, I believe most of the Selenium actions are detected with this specific antibot I am trying to avoid. I moved to using Playwright in JS for now.

noodleman420 avatar Jul 11 '22 04:07 noodleman420