docs/api/puppeteer.frame.locator.md
Creates a locator for the provided selector. See Locator for details and supported actions.
class Frame {
locator<Selector extends string>(
selector: Selector,
): Locator<NodeFor<Selector>>;
}
Parameter
</th><th>Type
</th><th>Description
</th></tr></thead> <tbody><tr><td>selector
</td><td>Selector
</td><td>selector to query the page for. CSS selectors can be passed as-is and a Puppeteer-specific selector syntax allows querying by text, a11y role and name, and xpath and combining these queries across shadow roots. Alternatively, you can specify the selector type using a prefix.
</td></tr> </tbody></table>Returns:
<h2 id="overload-2">locator(): Locator<Ret></h2>Creates a locator for the provided function. See Locator for details and supported actions.
class Frame {
locator<Ret>(func: () => Awaitable<Ret>): Locator<Ret>;
}
Parameter
</th><th>Type
</th><th>Description
</th></tr></thead> <tbody><tr><td>func
</td><td>() => Awaitable<Ret>
</td><td> </td></tr> </tbody></table>Returns:
Locator<Ret>