Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paveldymkov/puppeteer-shadow-selector
https://github.com/paveldymkov/puppeteer-shadow-selector
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/paveldymkov/puppeteer-shadow-selector
- Owner: PavelDymkov
- Created: 2021-05-26T16:01:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-26T16:50:22.000Z (over 3 years ago)
- Last Synced: 2024-04-25T02:41:01.626Z (9 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# puppeteer-shadow-selector
`puppeteer-shadow-selector` helps to select elements in Shadow DOM.
```html
#shadow-root (open)
```
```js
import * as puppeteer from "puppeteer";
import { $ } from "puppeteer-shadow-selector";async function example() {
const browser = await puppeteer.launch();
const page = await browser.newPage();await page.goto("http://localhost");
const input = await $(page, `my-component::part(text)`);
// or await $(page, `my-component::shadow-dom([part="text"])`);
// or await $(page, `my-component::shadow-dom(input)`);if (input) await input.type("Hello, World!");
}
example();
```