puppeteer/docs/guides/network-logging.md
2024-04-11 11:08:28 +02:00

15 lines
311 B
Markdown

# Network logging
By default, Puppeteer listens for all network requests and responses and emits network events on the page.
```ts
const page = await browser.newPage();
page.on('request', request => {
console.log(request.url());
});
page.on('response', response => {
console.log(response.url());
});
```