October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober 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 Scroll a Page With the Puppeteer Mouse Wheel

Use Puppeteer's awaited page.mouse.wheel({deltaY}) to send wheel input, or locator.scroll() to target a specific element.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use await page.mouse.wheel({deltaY: 100}) to send a downward mouse-wheel event in Puppeteer. A negative deltaY requests upward movement. Await the call before running steps that depend on the scroll.

Scroll the page with page.mouse.wheel()

Call wheel() on the page’s mouse object, passing the vertical scroll amount as deltaY:

As an Amazon Associate I earn from qualifying purchases.

await page.mouse.wheel({deltaY: 100});

Puppeteer’s API describes this method as dispatching a mousewheel event. The returned value is a promise, so use await in an async function. Puppeteer: Mouse.wheel()

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

Scroll up or down

  • deltaY: 100 requests downward movement.
  • deltaY: -100 requests movement in the opposite direction; Puppeteer’s official example uses this negative value.

The amount is an input to a wheel event, not a guarantee that the page will move by exactly that many pixels. Page behavior, scroll position, and the element under the pointer can affect the result.

Minimal runnable example

This example assumes you have already created a Puppeteer page and navigated it to the page you want to control:

async function scrollDown(page) {
  await page.mouse.wheel({deltaY: 100});
}

await scrollDown(page);

For a complete browser flow, put the call inside an async function after navigation:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await page.mouse.wheel({deltaY: 100});
  } finally {
    await browser.close();
  }
})();

Scroll a specific element with a locator

When the target is a particular scrollable element, Puppeteer’s interactions guide documents locator-based scrolling:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.locator('div').scroll({
  scrollLeft: 10,
  scrollTop: 20,
});

Replace div with a selector that identifies the intended element. The locator’s scroll() method uses mouse-wheel events. Before scrolling, the locator ensures the target is in the viewport, waits for visibility, and waits for a stable bounding box over two consecutive animation frames. See Puppeteer: Page interactions.

Choose the method by what you need to control

Method Target Use it when
page.mouse.wheel({deltaY}) Wheel input through the page mouse Your automation needs to dispatch a wheel event.
page.locator(selector).scroll({scrollLeft, scrollTop}) A selected element You want locator-based scrolling and its visibility and stability preconditions.
page.evaluate(...) Page context and DOM state You need to change or inspect scroll state directly rather than send wheel input.

Wheel input versus changing scroll state directly

page.evaluate() runs a function in the page context and returns its result. It is a different mechanism from page.mouse.wheel(): use wheel input when the behavior under test or automation depends on receiving a wheel event; use page-context code when the goal is to manipulate scroll state directly. The Page.evaluate() API documents the page-context approach.

Coordinate and event caveats

Puppeteer’s mouse works in main-frame CSS pixels relative to the viewport’s top-left corner. Its events are synthetic and do not fully reproduce a real user’s mouse behavior. If the page depends on detailed input behavior, validate the result in the browser and page relevant to your automation rather than assuming synthetic input matches a physical mouse. See Puppeteer: Mouse class.

Troubleshoot wheel scrolling

  • The next action runs too soon: make the wheel call asynchronous and await it before continuing.
  • The page does not appear to move: check that the page or intended element can scroll in that direction, and that the pointer is positioned where the page expects wheel input. A wheel event does not guarantee movement.
  • You meant to scroll a nested panel: target that element with page.locator(selector).scroll(...) instead of assuming page-level wheel input will affect the intended container.
  • The application responds differently than a real user session: Puppeteer’s mouse events are synthetic; verify the interaction in the relevant browser and page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo captures a page as an image or PDF; it does not send Puppeteer mouse-wheel input or test scroll-triggered behavior. If your goal is a screenshot rather than automating scrolling, one GET request can return a capture. This example saves the response as WebP:

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

See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. It also provides an MCP server for AI agents to take screenshots. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
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.