puppeteer/new-docs/puppeteer.page._.md
Changhao Han adeffbaac1
docs(new): migrate Page.ts to TSDoc (part 0 / 2) (#6104)
* docs(new): migrate Page.ts to TSDoc (part 0 / 2)

Co-authored-by: Changhao Han <changhaohan@chromium.org>
2020-06-26 09:24:56 +02:00

29 lines
838 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Page](./puppeteer.page.md) &gt; [$](./puppeteer.page._.md)
## Page.$() method
Runs `document.querySelector` within the page. If no element matches the selector, the return value resolves to `null`<!-- -->.
<b>Signature:</b>
```typescript
$(selector: string): Promise<ElementHandle | null>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| selector | string | A [selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) to query page for. |
<b>Returns:</b>
Promise&lt;[ElementHandle](./puppeteer.elementhandle.md) \| null&gt;
## Remarks
Shortcut for [Page.mainFrame().$(selector)](./puppeteer.frame._.md)<!-- -->.