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 desk6 min

Puppeteer WaitFor Options Explained: Choose the Right Page Wait

Choose Puppeteer waits by the condition your next step needs: navigation lifecycle, selector presence or visibility, or an application-specific predicate.

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.

Puppeteer’s WaitForOptions controls navigation waits: signal cancels a wait, timeout limits how long it can run, and waitUntil selects the lifecycle event or events that complete it. For elements, use waitForSelector(); for application-specific readiness, use waitForFunction(). The reliable choice is the condition your next step actually needs—not an arbitrary delay.

What does Puppeteer’s WaitForOptions control?

The current Puppeteer API reference identifies WaitForOptions with the 25.12.0 documentation. It is an options object for navigation-style waits, not the options object for selector visibility. Its controls are:

As an Amazon Associate I earn from qualifying purchases.

Option What it does Default and notes
timeout Maximum time to wait, in milliseconds. 30,000 ms by default; set to 0 to disable the timeout. Defaults can be adjusted with Page.setDefaultTimeout() or Page.setDefaultNavigationTimeout().
signal Accepts an AbortSignal that cancels the wait. Optional.
waitUntil Chooses the lifecycle event or events that count as completion. load by default. If you pass an array, every listed event must fire.

Use waitUntil to decide when a navigation wait has reached the lifecycle milestone your code needs. It does not control whether an element is visible. The official WaitForOptions reference documents the interface and defaults.

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

Choose a wait based on the condition you need

Requirement Wait to use Important behavior
A selector exists page.waitForSelector(selector) Resolves when a match exists; resolves immediately if it already exists.
A matching element is visible page.waitForSelector(selector, { visible: true }) Requires a match not hidden by display: none or visibility: hidden.
A matching element is absent or hidden page.waitForSelector(selector, { hidden: true }) Absence itself counts as success; the result may be null.
An application-specific condition is true page.waitForFunction(fn, options, ...args) Waits for the supplied page-context function to return a truthy value.
An action triggers navigation page.waitForNavigation(options) alongside the action Start the wait before the action, together in Promise.all().

Wait for a selector to exist, appear, or become hidden

WaitForSelectorOptions has its own controls: visible, hidden, timeout, and signal. Both visibility flags default to false; use the one that describes the required state.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
  • await page.waitForSelector('.results') waits for a matching element to exist. It does not require the element to be visible.
  • await page.waitForSelector('.results', { visible: true }) waits until the matching element exists and is not hidden by the two documented CSS states. This does not establish that the element is in the viewport or unobstructed.
  • await page.waitForSelector('.loading', { hidden: true }) succeeds when no match exists or when the match is hidden. It does not require the selector to have appeared first.

Selector waits default to 30,000 ms; timeout: 0 disables that limit. You can change the page-level default with Page.setDefaultTimeout(). An appearance wait throws if the selector does not appear before its timeout. See the official WaitForSelectorOptions and Page.waitForSelector() references.

For example, if a page displays a loading indicator and then renders results, wait for the results selector or for the indicator to become hidden—whichever state the next operation truly depends on. If the indicator was never present, a hidden wait can already be satisfied.

Wait for an application-specific predicate

Use page.waitForFunction(pageFunction, options, ...args) when readiness is not adequately represented by a selector or navigation lifecycle event. Puppeteer repeatedly evaluates the function in the page context until it returns a truthy value. The options support polling, timeout, and signal.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • polling: 'raf' checks on animation frames and is the documented default.
  • polling: 'mutation' checks in response to DOM mutations.
  • polling: 100 checks at a numeric interval in milliseconds.

For example, wait on a page-owned readiness flag if the application sets one:

await page.waitForFunction(() => window.appReady === true, {
  polling: 'raf',
  timeout: 10_000,
});

The predicate is your definition of ready: a successful wait proves only that it returned a truthy value. It does not prove every image, request, or application task is complete. Keep the condition narrow and tied to the work that follows. The Page.waitForFunction() reference describes its options.

Set a timeout or cancel a wait

Use a per-call timeout when one operation needs a different limit from the configured default. Set timeout: 0 only when an unbounded wait is deliberate; otherwise a missing condition can leave work waiting indefinitely. For navigation waits, Page.setDefaultNavigationTimeout() can change the default; Page.setDefaultTimeout() provides a page-level timeout default for selector waits.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

To stop a wait when its surrounding task is cancelled, pass an AbortSignal. The option is supported by navigation, selector, and function waits. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const controller = new AbortController();

const wait = page.waitForSelector('.results', {
  timeout: 15_000,
  signal: controller.signal,
});

// If your own task is cancelled before the selector appears:
controller.abort();

await wait;

Aborting intentionally cancels the pending wait; handle that cancellation in your surrounding control flow if cancellation is expected. Check the API reference for your installed Puppeteer version when maintaining code pinned to an older release.

Pair a navigation wait with the action that triggers it

Create the navigation wait before triggering navigation. If code clicks first and only then starts waiting, navigation can happen in the gap. Puppeteer’s documented pattern is to run both promises together:

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
const [response] = await Promise.all([
  page.waitForNavigation({ waitUntil: 'domcontentloaded' }),
  page.click('a.next'),
]);

Here, domcontentloaded is an example, not a universal best setting. Choose the lifecycle event that corresponds to what the next step needs. The default for waitUntil is load; passing an array means all specified lifecycle events must fire. The Puppeteer Page reference documents the navigation-wait pattern.

Account for frames and element-handle lifetimes

A selector wait tied to an existing ElementHandle has a different lifecycle from a frame-level wait. ElementHandle.waitForSelector() is tied to that current element; it does not work across navigations or after that element is detached. A frame-level waitForSelector() works across navigations. Choose the frame-level method if the page may navigate while waiting, and avoid relying on a handle that can become stale. See ElementHandle.waitForSelector() and Frame.waitForSelector(). The Frame reference surfaced as version 25.10.0; confirm behavior against the version installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot waits that time out or finish too early

  • A selector wait times out: confirm the selector matches the page’s actual DOM and that the target is expected to appear before the timeout. If visibility is required, use visible: true; a plain selector wait tests presence only.
  • A visible wait resolves, but the element is not usable: Puppeteer’s documented visibility condition only excludes display: none and visibility: hidden. It does not promise that the element is in the viewport or unobscured; wait for the condition your interaction actually needs.
  • A hidden wait resolves immediately: that is expected when the selector has no match. Absence counts as success.
  • A navigation wait misses the navigation: create it in the same Promise.all() as the click or other triggering action, with the wait listed first.
  • A navigation wait takes longer than expected: check whether the default load milestone is more than the next step requires. Choose an appropriate waitUntil value rather than disabling timeouts without a reason.
  • A function wait returns too early: make its predicate express the actual application condition, not a weak proxy. A truthy result means only that the supplied function returned truthy.
  • A wait does not follow a navigation: if waiting through navigation, prefer a frame-level selector wait over an element-handle wait tied to an existing element.

Or skip the browser setup

If your task is to capture a page rather than automate its interactions, ScreenshotNeo is a website screenshot API with a one-request workflow. For a clean WebP screenshot:

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
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 accepts cookie and 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 response headers say which verdict applied and whether the request was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

What is the default Puppeteer wait timeout?

The documented default is 30,000 milliseconds. Set `timeout: 0` to disable the timeout.

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.

Does `visible: true` mean an element is on screen?

No. The documented condition excludes `display: none` and `visibility: hidden`; it does not guarantee viewport placement or that another element is not covering it.

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
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.