This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wait (ms) { | |
return new Promise(resolve => setTimeout(() => resolve(), ms)); | |
} | |
export default async function capture(browser, url) { | |
// Load the specified page | |
const page = await browser.newPage(); | |
await page.goto(url, {waitUntil: 'load'}); | |
// Get the height of the rendered page |