Puppeteer-extra: Human like mouse movements

Created on 25 May 2020  路  8Comments  路  Source: berstend/puppeteer-extra

Is it possible to do something similar to this with puppeteer-extra?

idea

Most helpful comment

Would be interesting to have some king of puppeteer extra plugin that would help with this, somehow.

Maybe if I will have some extra free time and nothing interesting to do I could make a plugin for that purpose.

All 8 comments

The only thing i could find that mimics human behavior a bit that still works, is https://github.com/Xetera/ghost-cursor

There's a few more out there, but either they are "abandoned" or doesn't work anymore.

I'm using https://github.com/octalmage/robotjs and i retrieve element's position through getBoundingClientRect.
Robotjs has an advantage that it used C binding to really move mouse indipendently of puppeteer usage

@marcio199226 Thank you for the share, was not aware of that library!

Need to experiment with it soon :)

There's two methods that I use for this that might be of interest..

First is picking two random points (or the the current mouse position and the points of the element I want to move the mouse to), and using https://github.com/Pomax/bezierjs to generate a nice human looking curve. Then just pick a handful of points from the curve and add some noise to them and stop the mouse at a logical number along the curve depending on how short the distance is.

Second is if there is a specific site that I need to map, I will create a cloned version of the css / layout with some comedic content on it and push a bunch of cheap third-world traffic to it and record the client-side mouse movements. After we have a good sample we can either replay them 1:1 scaled to the correct viewport size in between our real actions for noise, or "average" them on the fly to make unique but coherent patterns.

Would be interesting to have some king of puppeteer extra plugin that would help with this, somehow.

Would be interesting to have some king of puppeteer extra plugin that would help with this, somehow.

Maybe if I will have some extra free time and nothing interesting to do I could make a plugin for that purpose.

With @Niek taking over ghost-cursor this can probably close right? 馃

With @Niek taking over ghost-cursor this can probably close right? 馃

Yes. 馃槃

Was this page helpful?
0 / 5 - 0 ratings