From 8d7d15fdb162010932598db44d529eebefd9a45c Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 27 Jul 2017 19:23:21 -0700 Subject: [PATCH] Update README.md Make README.md examples consistent. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index feaccc5d..c80a5cd6 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ yarn # or 'npm install' To navigate to https://example.com and save a screenshot as *example.png*, save the following script as `example.js` and run it using `node example.js`: ```js -const Browser = require('puppeteer').Browser; +const {Browser} = require('puppeteer'); const browser = new Browser(); browser.newPage().then(async page => { @@ -78,6 +78,9 @@ Since Puppeteer's code is run by Node, it exists out-of-process to the controlle It is recommended to use `async/await` to consume asynchronous api: ```js +const {Browser} = require('puppeteer'); +const browser = new Browser(); + browser.newPage().then(async page => { await page.setViewport({width: 1000, height: 1000}); await page.pdf({path: 'blank.pdf'});