Xetera / ghost-cursor

🖱️ Generate human-like mouse movements with puppeteer or on any 2D plane
MIT License
1.03k stars 120 forks source link

Cursor Movement and Clicking Not Working For Any Selectors #65

Closed cyrusnaficy closed 2 years ago

cyrusnaficy commented 2 years ago

This is the example of the error that I get

Warning: could not move mouse, error message: ProtocolError: Protocol error (Input.dispatchMouseEvent): Invalid parameter Invalid parameters

I can confirm that the selectors I am using are valid. I haven't been getting this problem only until recently. Haven't changed anything up so I am a bit confused why it is happening

cyrusnaficy commented 2 years ago

Nevermind, after an hour of searching I somehow found the issue. For some reason this package doesn't work with puppeteer-core. Not sure why, I will look into it and possibly make a pr

hackermondev commented 2 years ago

Experiencing same issue but I'm using puppeteer-extra

hackermondev commented 2 years ago

I had to create the cursor after the element was loaded to fix it.

cyrusnaficy commented 2 years ago

I had to create the cursor after the element was loaded to fix it.

So you have to create a new cursor variable every time you switch pages? You should only have to define cursor one time throughout your script.