summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/examples/screenshot.js
blob: 85c8462cb53dac7101dc7bfa680916c15da7fbdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * @license
 * Copyright 2017 Google Inc.
 * SPDX-License-Identifier: Apache-2.0
 */

'use strict';

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('http://example.com');
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();