Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/paveldymkov/puppeteer-shadow-selector


https://github.com/paveldymkov/puppeteer-shadow-selector

Last synced: 2 months ago
JSON representation

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();
```