October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Click at Specific Coordinates With the Puppeteer Mouse API

Use Puppeteer’s awaited mouse.click(x, y) call to click a viewport point, or use a locator when the target is a known page element.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use await page.mouse.click(x, y). The coordinates are CSS pixels measured from the top-left corner of the page viewport: x is horizontal and y is vertical. They are not desktop-screen coordinates or positions in the full document.

Click a point in the viewport

With an existing Puppeteer Page, call its mouse property and await the click:

As an Amazon Associate I earn from qualifying purchases.

// `page` is an existing Puppeteer Page.
await page.mouse.click(250, 120);

This targets a point 250 CSS pixels to the right and 120 CSS pixels below the viewport’s top-left corner. Use coordinates in that same frame when deriving a point from a screenshot or page layout. See the Puppeteer Mouse API reference.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Control the click or mouse movement

mouse.click(x, y, options) is a shortcut for moving to the point, pressing the mouse button, and releasing it. For explicit control, call those operations separately:

await page.mouse.move(250, 120);
await page.mouse.down();
await page.mouse.up();

The default click button is left. The documented alternatives are right, middle, back, and forward:

await page.mouse.click(250, 120, { button: 'right' });

To emit intermediate movement events on the way to a point, pass steps to mouse.move. Its documented default is one step:

await page.mouse.move(250, 120, { steps: 5 });
await page.mouse.click(250, 120);

A higher step count creates intermediate movement events; it does not establish that the movement is equivalent to a human moving a physical mouse.

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

Choose coordinates or a locator

Approach Best for What it does
page.mouse.click(x, y) A task where the point itself matters, or where you need mouse events without selecting an element first. Clicks the specified viewport coordinate; you are responsible for choosing a point that still targets the intended content.
page.locator(selector).click() A known element on a page whose layout may change. The current Puppeteer guide says a locator checks viewport presence, waits for visibility and enabled state, and waits for a stable bounding box across consecutive animation frames.
page.click(selector) Existing code using the older selector-based API. Finds the selector, scrolls the element into view if needed, and clicks its center using Page.mouse.

For a known button, for example, prefer the locator when you do not specifically need a coordinate:

await page.locator('button').click();

See the Puppeteer page interactions guide for locator behavior and the Page.click API reference for the selector-based method.

Coordinate clicks are synthetic mouse events

Puppeteer documents its mouse events as synthetic MouseEvents; they do not fully reproduce everything a person can do with a physical mouse. In particular, the Mouse reference says page.mouse cannot drag or select text. For actual text selection, it points to the DOM Selection API. Do not assume a coordinate click is indistinguishable from physical user input.

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

Wait for navigation after a selector click

For the documented Page.click selector pattern, Puppeteer warns that waiting for navigation separately can race with the click. Start both together:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const [response] = await Promise.all([
  page.waitForNavigation(),
  page.click('a.some-link'),
]);

This guidance is specifically for the selector-based Page.click pattern; it should not be generalized to every coordinate click.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

Or skip the browser setup

If you need a clean screenshot rather than mouse interaction inside a Puppeteer page, ScreenshotNeo provides a screenshot API. A single GET request captures the target URL; replace the example URL with the page you need. See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
  • Cookie banners and consent overlays, newsletter popups, and chat widgets are removed before capture; each cleanup step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Response headers report the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month, with no card.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.