You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/). Puppeteer runs [headless](https://developers.google.com/web/updates/2017/04/headless-chrome) by default, but can be configured to run full (non-headless) Chrome or Chromium.
12
12
@@ -37,7 +37,7 @@ npm i puppeteer
37
37
# or "yarn add puppeteer"
38
38
```
39
39
40
-
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, see [Environment variables](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#environment-variables).
40
+
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, see [Environment variables](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#environment-variables).
41
41
42
42
43
43
### puppeteer-core
@@ -60,7 +60,7 @@ See [puppeteer vs puppeteer-core](https://github.com/GoogleChrome/puppeteer/blob
60
60
Note: Puppeteer requires at least Node v6.4.0, but the examples below use async/await which is only supported in Node v7.6.0 or greater.
61
61
62
62
Puppeteer will be familiar to people using other browser testing frameworks. You create an instance
63
-
of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#).
63
+
of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#).
64
64
65
65
**Example** - navigating to https://example.com and saving a screenshot as *example.png*:
66
66
@@ -85,7 +85,7 @@ Execute script on the command line
85
85
node example.js
86
86
```
87
87
88
-
Puppeteer sets an initial page size to 800px x 600px, which defines the screenshot size. The page size can be customized with [`Page.setViewport()`](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#pagesetviewportviewport).
88
+
Puppeteer sets an initial page size to 800×600px, which defines the screenshot size. The page size can be customized with [`Page.setViewport()`](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#pagesetviewportviewport).
89
89
90
90
**Example** - create a PDF.
91
91
@@ -110,7 +110,7 @@ Execute script on the command line
110
110
node hn.js
111
111
```
112
112
113
-
See [`Page.pdf()`](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#pagepdfoptions) for more information about creating pdfs.
113
+
See [`Page.pdf()`](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#pagepdfoptions) for more information about creating pdfs.
114
114
115
115
**Example** - evaluate script in the context of the page
116
116
@@ -145,7 +145,7 @@ Execute script on the command line
145
145
node get-dimensions.js
146
146
```
147
147
148
-
See [`Page.evaluate()`](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#pageevaluatepagefunction-args) for more information on `evaluate` and related methods like `evaluateOnNewDocument` and `exposeFunction`.
148
+
See [`Page.evaluate()`](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#pageevaluatepagefunction-args) for more information on `evaluate` and related methods like `evaluateOnNewDocument` and `exposeFunction`.
149
149
150
150
<!-- [END getstarted] -->
151
151
@@ -154,7 +154,7 @@ See [`Page.evaluate()`](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/d
154
154
155
155
**1. Uses Headless mode**
156
156
157
-
Puppeteer launches Chromium in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). To launch a full version of Chromium, set the ['headless' option](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#puppeteerlaunchoptions) when launching a browser:
157
+
Puppeteer launches Chromium in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). To launch a full version of Chromium, set the [`headless` option](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#puppeteerlaunchoptions) when launching a browser:
158
158
159
159
```js
160
160
constbrowser=awaitpuppeteer.launch({headless:false}); // default is true
@@ -170,7 +170,7 @@ pass in the executable's path when creating a `Browser` instance:
See [`Puppeteer.launch()`](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#puppeteerlaunchoptions) for more information.
173
+
See [`Puppeteer.launch()`](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#puppeteerlaunchoptions) for more information.
174
174
175
175
See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.
176
176
@@ -182,7 +182,7 @@ Puppeteer creates its own Chromium user profile which it **cleans up on every ru
-[Community list of Puppeteer resources](https://github.com/transitive-bullshit/awesome-puppeteer)
188
188
@@ -372,7 +372,7 @@ await page.evaluate(() => {
372
372
373
373
You may find that Puppeteer does not behave as expected when controlling pages that incorporate audio and video. (For example, [video playback/screenshots is likely to fail](https://github.com/GoogleChrome/puppeteer/issues/291).) There are two reasons for this:
374
374
375
-
* Puppeteer is bundled with Chromium--not Chrome--and so by default, it inherits all of [Chromium's media-related limitations](https://www.chromium.org/audio-video). This means that Puppeteer does not support licensed formats such as AAC or H.264. (However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the [`executablePath` option to `puppeteer.launch`](https://github.com/GoogleChrome/puppeteer/blob/v1.19.0/docs/api.md#puppeteerlaunchoptions). You should only use this configuration if you need an official release of Chrome that supports these media formats.)
375
+
* Puppeteer is bundled with Chromium — not Chrome — and so by default, it inherits all of [Chromium's media-related limitations](https://www.chromium.org/audio-video). This means that Puppeteer does not support licensed formats such as AAC or H.264. (However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the [`executablePath` option to `puppeteer.launch`](https://github.com/GoogleChrome/puppeteer/blob/v1.20.0/docs/api.md#puppeteerlaunchoptions). You should only use this configuration if you need an official release of Chrome that supports these media formats.)
376
376
* Since Puppeteer (in all configurations) controls a desktop version of Chromium/Chrome, features that are only supported by the mobile version of Chrome are not supported. This means that Puppeteer [does not support HTTP Live Streaming (HLS)](https://caniuse.com/#feat=http-live-streaming).
377
377
378
378
#### Q: I am having trouble installing / running Puppeteer in my test environment. Where should I look for help?
0 commit comments