If Puppeteer doesn't find them in the environment during the installation step, a lowercased variant of these variables will be used from the <ahref="https://docs.npmjs.com/cli/config"target="_blank"rel="noopener noreferrer">npm config</a>.</p><ul><li><code>HTTP_PROXY</code>, <code>HTTPS_PROXY</code>, <code>NO_PROXY</code> - defines HTTP proxy settings that are used to download and run the browser.</li><li><code>PUPPETEER_CACHE_DIR</code> - defines the directory to be used by Puppeteer for caching. Defaults to <ahref="https://nodejs.org/api/os.html#os_os_homedir"target="_blank"rel="noopener noreferrer"><code>os.homedir()/.cache/puppeteer</code></a>.</li><li><code>PUPPETEER_SKIP_CHROMIUM_DOWNLOAD</code> - do not download bundled Chromium during installation step.</li><li><code>PUPPETEER_TMP_DIR</code> - defines the directory to be used by Puppeteer for creating temporary files. Defaults to <ahref="https://nodejs.org/api/os.html#os_os_tmpdir"target="_blank"rel="noopener noreferrer"><code>os.tmpdir()</code></a>.</li><li><code>PUPPETEER_DOWNLOAD_HOST</code> - specifies the URL prefix that is used to download Chromium. Note: this includes protocol and might even include path prefix. Defaults to <code>https://storage.googleapis.com</code>.</li><li><code>PUPPETEER_DOWNLOAD_PATH</code> - specifies the path for the downloads folder. Defaults to <code><cache>/chromium</code>, where <code><cache></code> is Puppeteer's cache directory.</li><li><code>PUPPETEER_BROWSER_REVISION</code> - specifies a certain version of the browser you'd like Puppeteer to use. See <ahref="https://pptr.dev/api/puppeteer.puppeteernode.launch"target="_blank"rel="noopener noreferrer"><code>puppeteer.launch</code></a> on how executable path is inferred.</li><li><code>PUPPETEER_EXECUTABLE_PATH</code> - specifies an executable path to be used in <ahref="https://pptr.dev/api/puppeteer.puppeteernode.launch"target="_blank"rel="noopener noreferrer"><code>puppeteer.launch</code></a>.</li><li><code>PUPPETEER_PRODUCT</code> - specifies which browser you'd like Puppeteer to use. Must be either <code>chrome</code> or <code>firefox</code>. This can also be used during installation to fetch the recommended browser binary. Setting <code>product</code> programmatically in <ahref="https://pptr.dev/api/puppeteer.puppeteernode.launch"target="_blank"rel="noopener noreferrer"><code>puppeteer.launch</code></a> supersedes this environment variable.</li><li><code>PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM</code> — specify Puppeteer download Chromium for Apple M1. On Apple M1 devices Puppeteer by default downloads the version for Intel's processor which runs via Rosetta. It works without any problems, however, with this option, you should get more efficient resource usage (CPU and RAM) that could lead to a faster execution time.</li></ul><p>Environment variables except for <code>PUPPETEER_CACHE_DIR</code> are not used for <ahref="#puppeteer-core"><code>puppeteer-core</code></a> since core does not automatically handle browser downloading.</p><h4class="anchor anchorWithStickyNavbar_LWe7"id="puppeteer-core"><code>puppeteer-core</code><aclass="hash-link"href="#puppeteer-core"title="Direct link to heading"></a></h4><p>Every release since v1.7.0 we publish two packages:</p><ul><li><ahref="https://www.npmjs.com/package/puppeteer"target="_blank"rel="noopener noreferrer"><code>puppeteer</code></a></li><li><ahref="https://www.npmjs.com/package/puppeteer-core"target="_blank"rel="noopener noreferrer"><code>puppeteer-core</code></a></li></ul><p><code>puppeteer</code> is a <em>product</em> for browser automation. When installed, it downloads a version of
Chromium, which it then drives using <code>puppeteer-core</code>. Being an end-user product, <code>puppeteer</code> supports a bunch of convenient <code>PUPPETEER_*</code> env variables to tweak its behavior.</p><p><code>puppeteer-core</code> is a <em>library</em> to help drive anything that supports DevTools protocol. <code>puppeteer-core</code> doesn't download Chromium when installed. Being a library, <code>puppeteer-core</code> is fully driven through its programmatic interface.</p><p>You should only use <code>puppeteer-core</code> if you are <ahref="https://pptr.dev/api/puppeteer.puppeteer.connect"target="_blank"rel="noopener noreferrer">connecting to a remote browser</a> or <ahref="https://pptr.dev/api/puppeteer.browserfetcher"target="_blank"rel="noopener noreferrer">managing browsers yourself</a>. If you are managing browsers yourself, you will need to call <ahref="https://pptr.dev/api/puppeteer.puppeteernode.launch"target="_blank"rel="noopener noreferrer"><code>puppeteer.launch</code></a> with an explicit <ahref="https://pptr.dev/api/puppeteer.launchoptions.executablepath"target="_blank"rel="noopener noreferrer"><code>executablePath</code></a> or <ahref="https://pptr.dev/api/puppeteer.launchoptions.channel"target="_blank"rel="noopener noreferrer"><code>channel</code></a>.</p><p>When using <code>puppeteer-core</code>, remember to change the import:</p><divclass="language-ts codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-ts codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#393A34"><spanclass="token keyword"style="color:#00009f">import</span><spanclass="token plain"> puppeteer </span><spanclass="token keyword"style="color:#00009f">from</span><spanclass="token plain"></span><spanclass="token string"style="color:#e3116c">'puppeteer-core'</span><spanclass="token punctuation"style="color:#393A34">;</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3class="anchor anchorWithStickyNavbar_LWe7"id="usage">Usage<aclass="hash-link"href="#usage"title="Direct link to heading"></a></h3><p>Puppeteer follows the latest <ahref="https://github.com/nodejs/Release#release-schedule"target="_blank"rel="noopener noreferrer">maintenance LTS</a> version of Node.</p><p>Puppeteer will be familiar to people using other browser testing frameworks. You <ahref="https://pptr.dev/api/puppeteer.puppeteernode.launch"target="_blank"rel="noopener noreferrer">launch</a>/<ahref="https://pptr.dev/api/puppeteer.puppeteernode.connect"target="_blank"rel="noopener noreferrer">connect</a> a <ahref="https://pptr.dev/api/puppeteer.browser"target="_blank"rel="noopener noreferrer">browser</a>, <ahref="https://pptr.dev/api/puppeteer.browser.newpage"target="_blank"rel="noopener noreferrer">create</a> some <ahref="https://pptr.dev/api/puppeteer.page"target="_blank"rel="noopener noreferrer">pages</a>, and then manipulate them with <ahref="https://pptr.dev/api"target="_blank"rel="noopener noreferrer">Puppeteer's API</a>.</p><p>For more in-depth usage, check our <ahref="https://pptr.dev/guides"target="_blank"rel="noopener noreferrer">guides</a> and <ahref="https://github.com/puppeteer/puppeteer/tree/main/examples"target="_blank"rel="noopener noreferrer">examples</a>.</p><h4class="anchor anchorWithStickyNavbar_LWe7"id="example">Example<aclass="hash-link"href="#example"title="Dire
pass in the executable's path when creating a <code>Browser</code> instance:</p><divclass="language-ts codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-ts codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#393A34"><spanclass="token keyword"style="color:#00009f">const</span><spanclass="token plain"> browser </span><spanclass="token operator"style="color:#393A34">=</span><spanclass="token plain"></span><spanclass="token keyword"style="color:#00009f">await</span><spanclass="token plain"> puppeteer</span><spanclass="token punctuation"style="color:#393A34">.</span><spanclass="token function"style="color:#d73a49">launch</span><spanclass="token punctuation"style="color:#393A34">(</span><spanclass="token punctuation"style="color:#393A34">{</span><spanclass="token plain">executablePath</span><spanclass="token operator"style="color:#393A34">:</span><spanclass="token plain"></span><spanclass="token string"style="color:#e3116c">'/path/to/Chrome'</span><spanclass="token punctuation"style="color:#393A34">}</span><spanclass="token punctuation"style="color:#393A34">)</span><spanclass="token punctuation"style="color:#393A34">;</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You can also use Puppeteer with Firefox Nightly (experimental support). See <ahref="https://pptr.dev/api/puppeteer.puppeteernode.launch"target="_blank"rel="noopener noreferrer"><code>Puppeteer.launch</code></a> for more information.</p><p>See <ahref="https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/"target="_blank"rel="noopener noreferrer"><code>this article</code></a> for a description of the differences between Chromium and Chrome. <ahref="https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/chromium_browser_vs_google_chrome.md"target="_blank"rel="noopener noreferrer"><code>This article</code></a> describes some differences for Linux users.</p><p><strong>3. Creates a fresh user profile</strong></p><p>Puppeteer creates its own browser user profile which it <strong>cleans up on every run</strong>.</p><h4class="anchor anchorWithStickyNavbar_LWe7"id="using-docker">Using Docker<aclass="hash-link"href="#using-docker"title="Direct link to heading"></a></h4><p>See our <ahref="https://pptr.dev/guides/docker"target="_blank"rel="noopener noreferrer">guide on using Docker</a>.</p><h4class="anchor anchorWithStickyNavbar_LWe7"id="using-chrome-extensions">Using Chrome Extensions<aclass="hash-link"href="#using-chrome-extensions"title="Direct link to heading"></a></h4><p>See our <ahref="https://pptr.dev/guides/chrome-extensions"target="_blank"rel="noopener noreferrer">guide on using Chrome extensions</a>.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="resources">Resources<aclass="hash-link"href="#resources"title="Direct link to heading"></a></h2><ul><li><ahref="https://pptr.dev/api"target="_blank"rel="noopener noreferrer">API Documentation</a></li><li><ahref="https://pptr.dev/guides"target="_blank"rel="noopener noreferrer">Guides</a></li><li><ahref="https://github.com/puppeteer/puppeteer/tree/main/examples"target="_blank"rel="noopener noreferrer">Examples</a></li><li><ahref="https://github.com/transitive-bullshit/awesome-puppeteer"target="_blank"rel="noopener noreferrer">Community list of Puppeteer resources</a></li><