Skip to content

Commit

Permalink
Update capture-screenshot.js
Browse files Browse the repository at this point in the history
  • Loading branch information
berlintay authored Aug 9, 2024
1 parent b707bba commit db12459
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions capture-screenshot.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const puppeteer = require('puppeteer');


async function captureScreenshot(url) {
const browser = await puppeteer.launch();
const page = await browser.newPage();



await page.goto(url);

await new Promise(resolve => setTimeout(resolve, 15000));


await new Promise(resolve => setTimeout(resolve, 15000));


await page.screenshot({ path: 'media/screenshot.png' });



await browser.close();
}

Expand Down

0 comments on commit db12459

Please sign in to comment.