mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
34ff00e2fe
* fix: added parts of website * fix: removed unnecessary lines * fix: updated contributing.md * fix: added parts of sidebar * fix: added all APIs * fix: added version 10.0.0 Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
1.2 KiB
1.2 KiB
Home > puppeteer > CustomQueryHandler
CustomQueryHandler interface
Contains two functions queryOne
and queryAll
that can be registered as alternative querying strategies. The functions queryOne
and queryAll
are executed in the page context. queryOne
should take an Element
and a selector string as argument and return a single Element
or null
if no element is found. queryAll
takes the same arguments but should instead return a NodeListOf<Element>
or Array<Element>
with all the elements that match the given query selector.
Signature:
export interface CustomQueryHandler
Properties
Property | Type | Description |
---|---|---|
queryAll? | (element: Element | Document, selector: string) => Element[] | NodeListOf<Element> | (Optional) |
queryOne? | (element: Element | Document, selector: string) => Element | null | (Optional) |