const puppeteer = require ('puppeteer')
const fs = require ('fs')


void (async () => {
  const url = process.argv[2]
  const output = process.argv[3]

  const browser = await puppeteer.launch ({
      args: ['--no-sandbox', '--disable-setuid-sandbox'] })

  const page = await browser.newPage ()
  await page.setViewport ({ width: 960, height: 960 })
  await page.goto (url, { waitUntil: 'networkidle2', timeout: 15000 })

  await page.screenshot ({ path: output })
  await browser.close ()
}) ()
