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

55 lines
802 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
<table><thead><tr><th>
2022-07-05 13:41:43 +00:00
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
selector
</td><td>
Selector
</td><td>
A `selector` to query page for
</td></tr>
</tbody></table>
2022-07-05 13:41:43 +00:00
**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).