Recommended Free Tools
To hover a DOM element, use await page.locator(selector).hover(). To move the pointer to a specific viewport point, use await page.mouse.move(x, y). Puppeteer’s locator action handles element readiness; coordinate movement gives you low-level control over the destination.
Hover over an element
For an element identified by a selector, use a locator:
As an Amazon Associate I earn from qualifying purchases.
await page.locator('button').hover();
Puppeteer recommends locators for selecting and interacting with elements. Locator hover brings the element into the viewport as needed, waits for it to be visible, and waits for its bounding box to remain stable across two consecutive animation frames before acting. Locator actions can retry when a target is not ready. See the Puppeteer page interactions guide.
This is usually the simplest choice for hover menus, tooltips, and other interactions where the target is a particular element rather than a particular screen position.
#1 Best Overall
Use page.hover() as a shortcut
You can also hover using the page-level method:
await page.hover('button');
It scrolls the matching element into view if needed and moves to its center. If multiple elements match, it uses the first; if none match, the call rejects. Use a selector specific enough to identify the intended target. See the Page.hover() API reference.
Move the mouse to a coordinate
For a point rather than an element, call page.mouse.move():
Rank #2
await page.mouse.move(250, 120);
The first number is the horizontal x coordinate and the second is the vertical y coordinate. Puppeteer measures both in main-frame CSS pixels from the viewport’s top-left corner—not from the full page’s top-left. See the Mouse.move() API reference.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →You can request intermediate pointer movements with the steps option:
await page.mouse.move(250, 120, { steps: 10 });
steps controls the number of movements from the current position to the destination and defaults to 1. This can matter when a page responds to the pointer’s path rather than only its final position. Puppeteer dispatches synthetic mouse events; they do not reproduce every property of a physical mouse. See the Mouse class documentation.
Move to a point inside an element
If you need coordinates derived from an element, get its bounding box, check that it exists, and calculate a point within it. This example moves to the center:
Rank #4
const element = await page.$('button');
if (!element) {
throw new Error('Button was not found');
}
const box = await element.boundingBox();
if (!box) {
throw new Error('Element has no layout box');
}
await page.mouse.move(
box.x + box.width / 2,
box.y + box.height / 2,
);
boundingBox() returns null if the element is not part of layout, such as when it has display: none. Bounding-box coordinates are relative to the main frame. See the ElementHandle.boundingBox() API reference. If all you need is to hover the element, locator hover avoids manually calculating the point.
Choose the right method
| Need | Use | What Puppeteer handles |
|---|---|---|
| Hover a selected element | page.locator(selector).hover() |
Viewport presence, visibility, and stable bounding box checks |
| Hover the first match for a selector | page.hover(selector) |
Scrolls into view and targets the element’s center; rejects if there is no match |
| Move to a known point | page.mouse.move(x, y) |
Moves to the supplied main-frame viewport coordinates |
| Move to a point calculated from an element | boundingBox() followed by page.mouse.move() |
You check for a missing element or layout box and calculate the point |
Troubleshoot pointer movement
- The element selector matches nothing: Check the selector and whether the element exists at the time of the call.
page.hover()rejects when there is no match; use an appropriately specific selector. - The locator cannot hover the target: Confirm the element is visible and can enter the viewport. Locator hover performs readiness checks, so an element that remains hidden or unstable may not be ready to interact with.
boundingBox()returnsnull: The element may not participate in layout—for example, it may usedisplay: none. Make it render before requesting its box, or use another target.- The pointer reaches the wrong place: Check coordinate order (
x, theny) and remember that coordinates are CSS pixels relative to the viewport’s top-left. For an element center, add half its width tobox.xand half its height tobox.y. - A hover interaction behaves differently from a real user’s: Puppeteer sends synthetic mouse events, which do not fully replicate physical mouse input. A page that depends on hardware-specific behavior may not respond identically.
Capture a page without setting up Puppeteer
Or skip the browser setup
If your goal is a screenshot rather than pointer interaction, ScreenshotNeo can return a page capture with one GET request. It accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in its headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.
Example cURL request (replace the URL with the page you want):
Best Value
- 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
See the ScreenshotNeo documentation for the API options. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.
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.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →

