save screenshot in full size page

This commit is contained in:
Kfir Dayan 2023-04-18 12:00:28 +03:00
parent 1376b14e2a
commit fb02db9b2f

View file

@ -31,7 +31,7 @@ export class CrawlerService {
// SCRIPTS // // SCRIPTS //
// SCREENSHOT // // SCREENSHOT //
const screenshotBuffer: Buffer = await page.screenshot(); const screenshotBuffer: Buffer = await page.screenshot({ fullPage: true });
fs.writeFile(`${directory}screenshot.png`, screenshotBuffer, (err) => { fs.writeFile(`${directory}screenshot.png`, screenshotBuffer, (err) => {
if (err) throw err; if (err) throw err;
console.log(`Screenshot saved! ${directory}screenshot.png`); console.log(`Screenshot saved! ${directory}screenshot.png`);