mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
74d9969744
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
53 lines
793 B
Markdown
53 lines
793 B
Markdown
---
|
|
sidebar_label: ElementHandle.$
|
|
---
|
|
|
|
# ElementHandle.$() method
|
|
|
|
Queries the current element for an element matching the given selector.
|
|
|
|
#### Signature:
|
|
|
|
```typescript
|
|
class ElementHandle {
|
|
$<Selector extends string>(
|
|
selector: Selector
|
|
): Promise<ElementHandle<NodeFor<Selector>> | null>;
|
|
}
|
|
```
|
|
|
|
## Parameters
|
|
|
|
<table><thead><tr><th>
|
|
|
|
Parameter
|
|
|
|
</th><th>
|
|
|
|
Type
|
|
|
|
</th><th>
|
|
|
|
Description
|
|
|
|
</th></tr></thead>
|
|
<tbody><tr><td>
|
|
|
|
selector
|
|
|
|
</td><td>
|
|
|
|
Selector
|
|
|
|
</td><td>
|
|
|
|
The selector to query for.
|
|
|
|
</td></tr>
|
|
</tbody></table>
|
|
**Returns:**
|
|
|
|
Promise<[ElementHandle](./puppeteer.elementhandle.md)<[NodeFor](./puppeteer.nodefor.md)<Selector>> \| null>
|
|
|
|
A [element handle](./puppeteer.elementhandle.md) to the first element matching the given selector. Otherwise, `null`.
|