From fb02db9b2ff8ece70618f4501154587cfbceae2c Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Tue, 18 Apr 2023 12:00:28 +0300 Subject: [PATCH] save screenshot in full size page --- src/crawler/crawler.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crawler/crawler.service.ts b/src/crawler/crawler.service.ts index b603cc7..0895d45 100644 --- a/src/crawler/crawler.service.ts +++ b/src/crawler/crawler.service.ts @@ -31,7 +31,7 @@ export class CrawlerService { // SCRIPTS // // SCREENSHOT // - const screenshotBuffer: Buffer = await page.screenshot(); + const screenshotBuffer: Buffer = await page.screenshot({ fullPage: true }); fs.writeFile(`${directory}screenshot.png`, screenshotBuffer, (err) => { if (err) throw err; console.log(`Screenshot saved! ${directory}screenshot.png`);