mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: add documentation (#8593)
This commit is contained in:
27
docs/api/puppeteer.page._.md
Normal file
27
docs/api/puppeteer.page._.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
sidebar_label: Page.$
|
||||
---
|
||||
|
||||
# Page.$() method
|
||||
|
||||
Runs `document.querySelector` within the page. If no element matches the selector, the return value resolves to `null`.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
class Page {
|
||||
$<Selector extends keyof HTMLElementTagNameMap>(
|
||||
selector: Selector
|
||||
): Promise<ElementHandle<HTMLElementTagNameMap[Selector]> | null>;
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| selector | Selector | A <code>selector</code> to query page for [selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) to query page for. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
Promise<[ElementHandle](./puppeteer.elementhandle.md)<HTMLElementTagNameMap\[Selector\]> \| null>
|
||||
Reference in New Issue
Block a user