Indent the code in README.md (#319)
This commit is contained in:
parent
f3143a3d60
commit
16e190b239
24
README.md
24
README.md
@ -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();
|
||||
})();
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user