Skip to content

Instantly share code, notes, and snippets.

@henrikhaugboelle
Created January 21, 2018 20:25
Show Gist options
  • Save henrikhaugboelle/ba715feb49eb176a364d2abbc631ddf3 to your computer and use it in GitHub Desktop.
Save henrikhaugboelle/ba715feb49eb176a364d2abbc631ddf3 to your computer and use it in GitHub Desktop.
module.exports = async () => {
const page = await browser.newPage()
await page.goto('https://www.example.com', {
waitUntil: 'networkidle'
})
// const html = await page.content()
const buffer = await page.screenshot()
await page.close()
return {
image: buffer.toString('base64')
// html
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment