<titledata-rh="true">Page.setContent() 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/api/puppeteer.page.setcontent"><metadata-rh="true"property="og:locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="docsearch:counter"content="2"><metadata-rh="true"property="og:title"content="Page.setContent() method | Puppeteer"><metadata-rh="true"name="description"content="Set the content of the page."><metadata-rh="true"property="og:description"content="Set the content of the page."><linkdata-rh="true"rel="icon"href="/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://pptr.dev/api/puppeteer.page.setcontent"><linkdata-rh="true"rel="alternate"href="https://pptr.dev/api/puppeteer.page.setcontent"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://pptr.dev/api/puppeteer.page.setcontent"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">
<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>html</p></td><td><p>string</p></td><td><p>HTML markup to assign to the page.</p></td></tr><tr><td><p>options</p></td><td><p><ahref="/api/puppeteer.waitforoptions">WaitForOptions</a></p></td><td><p><em>(Optional)</em> Parameters that has some properties.</p></td></tr></tbody></table>
<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>The parameter <code>options</code> might have the following options.</p>
<ul>
<li>
<p><code>timeout</code> : Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass <code>0</code> to disable timeout. The default value can be changed by using the <ahref="/api/puppeteer.page.setdefaultnavigationtimeout">Page.setDefaultNavigationTimeout()</a> or <ahref="/api/puppeteer.page.setdefaulttimeout">Page.setDefaultTimeout()</a> methods.</p>
</li>
<li>
<p><code>waitUntil</code>: When to consider setting markup succeeded, defaults to <code>load</code>. Given an array of event strings, setting content is considered to be successful after all events have been fired. Events can be either:<br> - <code>load</code> : consider setting content to be finished when the <code>load</code> event is fired.<br> - <code>domcontentloaded</code> : consider setting content to be finished when the <code>DOMContentLoaded</code> event is fired.<br> - <code>networkidle0</code> : consider setting content to be finished when there are no more than 0 network connections for at least <code>500</code> ms.<br> - <code>networkidle2</code> : consider setting content to be finished when there are no more than 2 network connections for at least <code>500</code> ms.</p>