Use page.mouse when an automation needs pointer input at specific viewport coordinates: move, click, press and drag, or send wheel input. For ordinary interaction with a known page element, Puppeteer recommends a locator instead. Mouse input is synthetic, and the API cannot drag-select text like a physical mouse.
What page.mouse does
Each Puppeteer Page exposes its own Mouse instance as page.mouse. It sends pointer events by coordinate rather than finding a target by selector. Coordinates are main-frame CSS pixels relative to the viewport’s top-left corner; they are not document coordinates. Use the instance on the page rather than constructing a Mouse yourself. The official documentation checked for this guide showed Puppeteer 25.12.0 on key pages; API page labels were not uniform, so check method signatures against the version installed in your project. Puppeteer Mouse class · Page class
As an Amazon Associate I earn from qualifying purchases.
Set up a page before sending mouse input
The following CommonJS example launches Chromium, opens a page, and performs a coordinate click. It assumes Puppeteer is installed in the project and a usable browser is available through its installation or configuration.
Recommended Free Tools
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
// Coordinates are CSS pixels from the viewport's top-left corner.
await page.mouse.click(120, 80);
} finally {
await browser.close();
}
})();
Replace the example URL and coordinates with the target page and a point in its current viewport. If the target is an element you can identify in the DOM, use a locator instead of guessing its coordinates.
#1 Best Overall
- Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
- Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
- Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
- Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
- Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
Click a coordinate
await page.mouse.click(120, 80);
click(x, y, options) is a convenience sequence: Puppeteer moves the pointer to the coordinate, presses the selected button, and releases it. The left button is the default; the documented button choices are left, right, middle, back, and forward. Use coordinate clicks when the point itself is the intended target, such as a canvas or a custom interface with no suitable element locator. Mouse.click() · MouseButton · MouseOptions
Move, press, and release for a drag path
await page.mouse.move(startX, startY);
await page.mouse.down();
await page.mouse.move(endX, endY);
await page.mouse.up();
These lower-level calls let you hold a button while changing coordinates, which is useful for interfaces that respond to pointer paths. move() returns a promise and accepts movement options; steps controls the number of movements between the previous and new positions and defaults to 1. The class reference also documents drag, drag-and-drop, drag-enter, drag-over, and drop operations for purpose-built sequences. These calls dispatch synthetic events; they do not promise to reproduce every operating-system mouse behavior. Mouse.move() · MouseMoveOptions
Rank #2
- The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
- Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
- G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
- Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
- The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere
Text selection is a limitation
Puppeteer’s Mouse API documentation states: “The mouse events trigger synthetic MouseEvents. This means that it does not fully replicate the functionality of what a normal user would be able to do with their mouse.” In particular, dragging with page.mouse cannot select text. To create a selection between DOM nodes, use the document or shadow-root Selection API with a Range; that is a DOM operation, not a simulated mouse gesture. For copying selected content, Puppeteer points to the clipboard API, whose use depends on clipboard permissions and tab focus. Mouse class limitations and selection example
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Send wheel input
await page.mouse.move(centerX, centerY);
await page.mouse.wheel({ deltaY: -100 });
Position the pointer over the relevant area first. wheel() dispatches a mousewheel event; a negative deltaY is used in the official example to demonstrate zooming. A wheel event does not guarantee ordinary document scrolling: the page’s handlers and browser behavior determine its effect. Mouse.wheel()
Rank #3
- Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
- Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
- Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
- Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
- Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
Choose between mouse coordinates and a locator
| Approach | How you specify the target | What it checks or controls | Best fit |
|---|---|---|---|
page.mouse |
Viewport coordinates | You control pointer position and the sequence of input; it does not first identify an element. | Custom pointer paths, canvas interactions, or cases where coordinates are specifically required. |
page.locator(...) |
A selector or other locator target | Before acting, Puppeteer checks viewport presence, visibility, enabled state, and bounding-box stability over consecutive animation frames. | Routine interaction with a page element. |
Puppeteer’s interactions guide recommends locators for finding and interacting with elements. A locator click, for example, avoids manually calculating the target’s current coordinates. For a compatibility option, page.click(selector) finds the first matching element, scrolls it into view if necessary, then uses Page.mouse to click its center. It rejects if no match exists. Page interactions guide · Page.click()
Wait reliably when a click navigates
If a selector click is expected to trigger navigation, start the navigation wait and click together. This avoids the race in which navigation begins before the wait is registered.
Rank #4
- Computer mouse for easily navigating a computer interface; click, scroll, and more
- USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
- High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
- 3 buttons offer effortless fingertip control
- Plug-and-go ready for instant use
const [response] = await Promise.all([
page.waitForNavigation(),
page.click('a.next'),
]);
Choose navigation-wait options appropriate to the application; the key is registering the wait in the same Promise.all as the click. Page.click() navigation example
Common problems and fixes
- The click lands on the wrong place: Coordinates are viewport-relative CSS pixels. Re-check the viewport size and target’s current location rather than treating coordinates as page-wide document positions. For a DOM element, switch to a locator.
- A drag gesture does not select text: This is a documented limitation of synthetic mouse events. Use a DOM
Rangeand Selection API for programmatic selection instead. - The page scrolls or zooms unexpectedly—or not at all: Wheel input is delivered at the pointer location, and page handlers determine the outcome. Move to the intended area, then inspect the page’s wheel behavior and event handling.
- A selector click fails because the element is absent:
page.click(selector)rejects when no matching element exists. Check the selector and whether the page has loaded the target; a locator is the recommended element-oriented interaction path. - A click-triggered navigation is missed: Register
waitForNavigation()alongside the click inPromise.all, rather than waiting only after clicking.
Or skip the browser setup
If the task is to capture a page rather than automate a pointer interaction, ScreenshotNeo offers a one-request screenshot API. This does not replace Puppeteer for interactive workflows; it returns a screenshot or PDF from a URL.
Best Value
- 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
- 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
- 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
- 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
- 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.
cURL example and API documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo removes supported cookie and consent banners, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Can I construct a Puppeteer Mouse directly?
Use the Mouse instance exposed by a Page as page.mouse; the constructor is internal.
Can Puppeteer’s mouse API produce physical mouse input?
No. The API dispatches synthetic mouse events and does not fully reproduce physical mouse functionality.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




