Indent the code in README.md (#319)

This commit is contained in:
Divjot Singh 2017-08-18 08:24:51 +05:30 committed by Andrey Lushnikov
parent f3143a3d60
commit 16e190b239

View File

@ -41,14 +41,14 @@ of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https:
```js
const puppeteer = require('puppeteer');
(async() => {
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
browser.close();
browser.close();
})();
```
@ -59,14 +59,14 @@ Puppeteer sets an initial page size to 800px x 600px, which defines the screensh
```js
const puppeteer = require('puppeteer');
(async() => {
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle'});
await page.pdf({path: 'hn.pdf', format: 'A4'});
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle'});
await page.pdf({path: 'hn.pdf', format: 'A4'});
browser.close();
browser.close();
})();
```