docs: fix screenshot guide (#12451)

This commit is contained in:
Alex Rudenko 2024-05-17 08:10:35 +02:00 committed by GitHub
parent 637e82796b
commit 6dd3aa7241
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
# Screenshots
For capturing screenshots use [`Page.screenshot()`](https://pptr.dev/api/puppeteer.screenshot.pdf).
For capturing screenshots use [`Page.screenshot()`](https://pptr.dev/api/puppeteer.page.screenshot).
```ts
const browser = await puppeteer.launch();
@ -9,7 +9,7 @@ await page.goto('https://news.ycombinator.com', {
waitUntil: 'networkidle2',
});
await page.screenshot({
path: 'hn.pdf',
path: 'hn.png',
});
await browser.close();