How to get mouse position with puppeteer

I’am trying to open a page with puppeteer, and in that page I want to move the mouse in that page to the position of the current mouse that iam using, but i cant find anything, so i was wondering if it was possible

Add Comment
1 Answer(s)

You can get the coordinates of the mouse by this way:

document.onmousemove = function(e){   mouseX = e.offsetX;   mouseY = e.offsetY;   console.log(mouseX, mouseY); }

Answered on July 16, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.