puppeteer/docs/api/puppeteer.page.__.md

32 lines
796 B
Markdown
Raw Normal View History

2022-07-05 13:41:43 +00:00
---
sidebar_label: Page.$$
---
# Page.$$() method
The method runs `document.querySelectorAll` within the page. If no elements match the selector, the return value resolves to `[]`.
#### Signature:
2022-07-05 13:41:43 +00:00
```typescript
class Page {
$$<Selector extends string>(
2022-07-05 13:41:43 +00:00
selector: Selector
): Promise<Array<ElementHandle<NodeFor<Selector>>>>;
2022-07-05 13:41:43 +00:00
}
```
## Parameters
| Parameter | Type | Description |
| --------- | -------- | ----------------------------------------- |
| selector | Selector | A <code>selector</code> to query page for |
**Returns:**
Promise&lt;Array&lt;[ElementHandle](./puppeteer.elementhandle.md)&lt;[NodeFor](./puppeteer.nodefor.md)&lt;Selector&gt;&gt;&gt;&gt;
2022-07-05 13:41:43 +00:00
## Remarks
Shortcut for [Page.mainFrame().$$(selector)](./puppeteer.frame.__.md).