Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
method ElementHandle.prototype.waitForSelector
Re-export
import { ElementHandle } from "https://deno.land/x/puppeteer@14.1.1/vendor/puppeteer-core/puppeteer/api-docs-entry.js";

Wait for the selector to appear within the element. If at the moment of calling the method the selector already exists, the method will return immediately. If the selector doesn't appear after the timeout milliseconds of waiting, the function will throw.

This method does not work across navigations or if the element is detached from DOM.

Parameters

selector: string
optional
options: { visible?: boolean; hidden?: boolean; timeout?: number; }
  • Optional waiting parameters

Returns

Promise<ElementHandle | null>

Promise which resolves when element specified by selector string is added to DOM. Resolves to null if waiting for hidden: true and selector is not found in DOM.