Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use await page.mouse.down() to press and await page.mouse.up() to release. The button stays held between those calls, so you can run other actions while it is down. For a simple click at coordinates, use await page.mouse.click(x, y) instead.

Press and release a mouse button

Each Puppeteer Page has a mouse object. Call its methods with await so the press and release happen in order:

await page.mouse.down();
// Run any intervening action while the left button is held.
await page.mouse.up();

By default, both methods use the left mouse button. To use a different button, pass the same button option to both calls:

await page.mouse.down({ button: 'right' });
// The right button remains held here.
await page.mouse.up({ button: 'right' });

Puppeteer documents left, right, middle, back, and forward as supported button values. See the Mouse API reference and Mouse.up() reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose between mouse methods and a locator

Need Use Why
A complete click at a coordinate page.mouse.click(x, y) It is a shortcut for moving to the coordinates, pressing, and releasing.
A held button with other actions between press and release page.mouse.down() followed by page.mouse.up() The separate calls give you explicit control over the held interval.
Clicking a specific page element page.locator(selector).click() The Puppeteer guide recommends locators for element interactions; they check viewport presence, visibility, enabled state, and a stable bounding box before clicking.

Use the mouse API when the action is coordinate-based or needs explicit press-and-release timing. Use a locator when the target is an element and its built-in checks are useful. References: Mouse.click() and Puppeteer page interactions.

Understand coordinates and event behavior

Mouse coordinates are CSS pixels relative to the top-left corner of the main-frame viewport, not the full page. Scrolling changes which page content occupies a viewport coordinate.

Puppeteer generates synthetic MouseEvents; its mouse methods do not reproduce every behavior of a physical mouse. In particular, the API documentation notes that dragging and selecting text are not possible using page.mouse. Avoid assuming that separate down() and up() calls reproduce every operating-system-level mouse interaction.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to produce a website screenshot rather than control a mouse, ScreenshotNeo offers a one-request screenshot API. Create an API key, then run this cURL command; replace the example URL with the page you need. See the ScreenshotNeo API documentation for request options.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
The SQL Programming Language: .
  • Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, and failed loads are not billed, and an MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan.

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.