Runs document.querySelector
within the page. If no element matches the selector, the return value resolves to null
.
Signature:
$(selector: string): Promise<ElementHandle | null>;
Parameter | Type | Description |
---|---|---|
selector | string | A selector to query page for. |
Returns:
Promise<ElementHandle | null>
Shortcut for Page.mainFrame().$(selector).