<titledata-rh="true">Page.goto() method | Puppeteer</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:url"content="https://pptr.dev/next/api/puppeteer.page.goto"><metadata-rh="true"property="og:locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="docsearch:counter"content="3"><metadata-rh="true"property="og:title"content="Page.goto() method | Puppeteer"><metadata-rh="true"name="description"content="Navigates the page to the given url."><metadata-rh="true"property="og:description"content="Navigates the page to the given url."><linkdata-rh="true"rel="icon"href="/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://pptr.dev/next/api/puppeteer.page.goto"><linkdata-rh="true"rel="alternate"href="https://pptr.dev/next/api/puppeteer.page.goto"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://pptr.dev/next/api/puppeteer.page.goto"hreflang="x-default"><linkdata-rh="true"rel="preconnect"href="https://DVKY664LG7-dsn.algolia.net"crossorigin="anonymous"><linkrel="search"type="application/opensearchdescription+xml"title="Puppeteer"href="/opensearch.xml">
<p>Navigates the page to the given <code>url</code>.</p>
<h4class="anchor anchorWithStickyNavbar_LWe7"id="signature">Signature:<ahref="#signature"class="hash-link"aria-label="Direct link to Signature:"title="Direct link to Signature:"></a></h4>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="parameters">Parameters<ahref="#parameters"class="hash-link"aria-label="Direct link to Parameters"title="Direct link to Parameters"></a></h2>
<table><thead><tr><th><p>Parameter</p></th><th><p>Type</p></th><th><p>Description</p></th></tr></thead><tbody><tr><td><p>url</p></td><td><p>string</p></td><td><p>URL to navigate page to. The URL should include scheme, e.g. <code>https://</code></p></td></tr><tr><td><p>options</p></td><td><p><ahref="/next/api/puppeteer.gotooptions">GoToOptions</a></p></td><td><p><em>(Optional)</em> Options to configure waiting behavior.</p></td></tr></tbody></table>
<p>A promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="exceptions">Exceptions<ahref="#exceptions"class="hash-link"aria-label="Direct link to Exceptions"title="Direct link to Exceptions"></a></h2>
<p>If:</p>
<ul>
<li>there's an SSL error (e.g. in case of self-signed certificates). - target URL is invalid. - the timeout is exceeded during navigation. - the remote server does not respond or is unreachable. - the main resource failed to load.</li>
</ul>
<p>This method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling <ahref="/next/api/puppeteer.httpresponse.status">HTTPResponse.status()</a>.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="remarks">Remarks<ahref="#remarks"class="hash-link"aria-label="Direct link to Remarks"title="Direct link to Remarks"></a></h2>
<p>Navigation to <code>about:blank</code> or navigation to the same URL with a different hash will succeed and return <code>null</code>.</p>
<divclass="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><divclass="admonitionHeading_Gvgb"><spanclass="admonitionIcon_Rf37"><svgviewBox="0 0 16 16"><pathfill-rule="evenodd"d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><divclass="admonitionContent_BuS1"><p>Headless mode doesn't support navigation to a PDF document. See the <ahref="https://bugs.chromium.org/p/chromium/issues/detail?id=761295"target="_blank"rel="noopener noreferrer">upstream issue</a>.</p></div></div>