readme: update exemple t odump links

This commit is contained in:
Pierre Tachoire
2025-02-18 11:15:06 +01:00
parent cd429f5935
commit f8d01e1596

View File

@@ -83,10 +83,20 @@ const browser = await puppeteer.connect({
const context = await browser.createBrowserContext();
const page = await context.newPage();
// Dump all the links from the page.
await page.goto('https://wikipedia.com/');
const links = await page.evaluate(() => {
return Array.from(document.querySelectorAll('a')).map(row => {
return row.getAttribute('href');
});
});
console.log(links);
await page.close();
await context.close();
await browser.disconnect();
```
## Build from sources