puppeteer/assets/js/ccf9c475.9f4089c8.js
release-please[bot] 5878dff7cb deploy: 03e10a7559
2024-06-11 09:40:10 +00:00

2 lines
62 KiB
JavaScript

/*! For license information please see ccf9c475.9f4089c8.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[85574],{26389:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>d,default:()=>p,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var r=t(85893),n=t(11151);const i={sidebar_label:"Page"},d="Page class",a={id:"api/puppeteer.page",title:"Page class",description:"Page provides methods to interact with a single tab or extension background page in the browser.",source:"@site/../docs/api/puppeteer.page.md",sourceDirName:"api",slug:"/api/puppeteer.page",permalink:"/next/api/puppeteer.page",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"Page"},sidebar:"api",previous:{title:"BrowserContext.waitForTarget",permalink:"/next/api/puppeteer.browsercontext.waitfortarget"},next:{title:"Page.$",permalink:"/next/api/puppeteer.page._"}},c={},l=[{value:"Signature:",id:"signature",level:4},{value:"Remarks",id:"remarks",level:2},{value:"Example 1",id:"example-1",level:2},{value:"Example 2",id:"example-2",level:2},{value:"Properties",id:"properties",level:2},{value:"Methods",id:"methods",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,n.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{id:"page-class",children:"Page class"}),"\n",(0,r.jsxs)(s.p,{children:["Page provides methods to interact with a single tab or ",(0,r.jsx)(s.a,{href:"https://developer.chrome.com/extensions/background_pages",children:"extension background page"})," in the browser."]}),"\n",(0,r.jsx)(s.admonition,{type:"note",children:(0,r.jsx)(s.p,{children:"One Browser instance might have multiple Page instances."})}),"\n",(0,r.jsx)(s.h4,{id:"signature",children:"Signature:"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-typescript",children:"export declare abstract class Page extends EventEmitter<PageEvents>\n"})}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Extends:"})," ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.eventemitter",children:"EventEmitter"}),"<",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.pageevents",children:"PageEvents"}),">"]}),"\n",(0,r.jsx)(s.h2,{id:"remarks",children:"Remarks"}),"\n",(0,r.jsxs)(s.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,r.jsx)(s.code,{children:"Page"})," class."]}),"\n",(0,r.jsx)(s.h2,{id:"example-1",children:"Example 1"}),"\n",(0,r.jsx)(s.p,{children:"This example creates a page, navigates it to a URL, and then saves a screenshot:"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ts",children:"import puppeteer from 'puppeteer';\n\n(async () => {\n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n await page.screenshot({path: 'screenshot.png'});\n await browser.close();\n})();\n"})}),"\n",(0,r.jsxs)(s.p,{children:["The Page class extends from Puppeteer's ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.eventemitter",children:"EventEmitter"})," class and will emit various events which are documented in the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.pageevent",children:"PageEvent"})," enum."]}),"\n",(0,r.jsx)(s.h2,{id:"example-2",children:"Example 2"}),"\n",(0,r.jsxs)(s.p,{children:["This example logs a message for a single page ",(0,r.jsx)(s.code,{children:"load"})," event:"]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ts",children:"page.once('load', () => console.log('Page loaded!'));\n"})}),"\n",(0,r.jsxs)(s.p,{children:["To unsubscribe from events use the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.eventemitter.off",children:"EventEmitter.off()"})," method:"]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ts",children:"function logRequest(interceptedRequest) {\n console.log('A request was made:', interceptedRequest.url());\n}\npage.on('request', logRequest);\n// Sometime later...\npage.off('request', logRequest);\n"})}),"\n",(0,r.jsx)(s.h2,{id:"properties",children:"Properties"}),"\n",(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Property"})}),(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Modifiers"})}),(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Type"})}),(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Description"})})]})}),(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"accessibility",children:"accessibility"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"readonly"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.accessibility",children:"Accessibility"})})}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/Screen_reader",children:"screen readers"})," or ",(0,r.jsx)(s.a,{href:"https://en.wikipedia.org/wiki/Switch_access",children:"switches"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output."}),(0,r.jsx)(s.p,{children:'Blink - Chrome\'s rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree.'}),(0,r.jsx)(s.p,{children:'Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree.'}),(0,r.jsxs)(s.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,r.jsx)(s.code,{children:"Accessibility"})," class."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"coverage",children:"coverage"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"readonly"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.coverage",children:"Coverage"})})}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["To output coverage in a form consumable by ",(0,r.jsx)(s.a,{href:"https://github.com/istanbuljs",children:"Istanbul"}),", see ",(0,r.jsx)(s.a,{href:"https://github.com/istanbuljs/puppeteer-to-istanbul",children:"puppeteer-to-istanbul"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"keyboard",children:"keyboard"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"readonly"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.keyboard",children:"Keyboard"})})}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Keyboard provides an api for managing a virtual keyboard. The high level api is ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.keyboard.type",children:"Keyboard.type()"}),", which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["For finer control, you can use ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.keyboard.down",children:"Keyboard.down()"}),", ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.keyboard.up",children:"Keyboard.up()"}),", and ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.keyboard.sendcharacter",children:"Keyboard.sendCharacter()"})," to manually fire events as if they were generated from a real keyboard."]}),(0,r.jsxs)(s.p,{children:["On macOS, keyboard shortcuts like ",(0,r.jsx)(s.code,{children:"\u2318 A"})," -> Select All do not work. See ",(0,r.jsx)(s.a,{href:"https://github.com/puppeteer/puppeteer/issues/1313",children:"#1313"}),"."]}),(0,r.jsxs)(s.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,r.jsx)(s.code,{children:"Keyboard"})," class."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"mouse",children:"mouse"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"readonly"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.mouse",children:"Mouse"})})}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Every ",(0,r.jsx)(s.code,{children:"page"})," object has its own Mouse, accessible with [",(0,r.jsx)(s.code,{children:"page.mouse"}),"](#pagemouse)."]}),(0,r.jsxs)(s.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,r.jsx)(s.code,{children:"Mouse"})," class."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"touchscreen",children:"touchscreen"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"readonly"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.touchscreen",children:"Touchscreen"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"The Touchscreen class exposes touchscreen events."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"tracing",children:"tracing"})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"readonly"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.tracing",children:"Tracing"})})}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"The Tracing class exposes the tracing audit interface."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["You can use ",(0,r.jsx)(s.code,{children:"tracing.start"})," and ",(0,r.jsx)(s.code,{children:"tracing.stop"})," to create a trace file which can be opened in Chrome DevTools or ",(0,r.jsx)(s.a,{href:"https://chromedevtools.github.io/timeline-viewer/",children:"timeline viewer"}),"."]}),(0,r.jsxs)(s.p,{children:["The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ",(0,r.jsx)(s.code,{children:"Tracing"})," class."]})]})]})]})]}),"\n",(0,r.jsx)(s.h2,{id:"methods",children:"Methods"}),"\n",(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Method"})}),(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Modifiers"})}),(0,r.jsx)("th",{children:(0,r.jsx)(s.p,{children:"Description"})})]})}),(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"_",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page._",children:"$(selector)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Finds the first element that matches the selector. If no element matches the selector, the return value resolves to ",(0,r.jsx)(s.code,{children:"null"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame._",children:"Page.mainFrame().$(selector)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"__",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.__",children:"$$(selector, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Finds elements on the page that match the selector. If no elements match the selector, the return value resolves to ",(0,r.jsx)(s.code,{children:"[]"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.__",children:"Page.mainFrame().$$(selector)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"__eval",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.__eval",children:"$$eval(selector, pageFunction, args)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This method returns all elements matching the selector and passes the resulting array as the first argument to the ",(0,r.jsx)(s.code,{children:"pageFunction"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["If ",(0,r.jsx)(s.code,{children:"pageFunction"})," returns a promise ",(0,r.jsx)(s.code,{children:"$$eval"})," will wait for the promise to resolve and then return its value."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"_eval",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page._eval",children:"$eval(selector, pageFunction, args)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This method finds the first element within the page that matches the selector and passes the result as the first argument to the ",(0,r.jsx)(s.code,{children:"pageFunction"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["If no element is found matching ",(0,r.jsx)(s.code,{children:"selector"}),", the method will throw an error."]}),(0,r.jsxs)(s.p,{children:["If ",(0,r.jsx)(s.code,{children:"pageFunction"})," returns a promise ",(0,r.jsx)(s.code,{children:"$eval"})," will wait for the promise to resolve and then return its value."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"addscripttag",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.addscripttag",children:"addScriptTag(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Adds a ",(0,r.jsx)(s.code,{children:"<script>"})," tag into the page with the desired URL or content."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.addscripttag",children:"page.mainFrame().addScriptTag(options)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"addstyletag",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.addstyletag",children:"addStyleTag(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Adds a ",(0,r.jsx)(s.code,{children:'<link rel="stylesheet">'})," tag into the page with the desired URL or a ",(0,r.jsx)(s.code,{children:'<style type="text/css">'})," tag with the content."]}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.addstyletag_1",children:"page.mainFrame().addStyleTag(options)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"addstyletag",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.addstyletag_1",children:"addStyleTag(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"authenticate",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.authenticate",children:"authenticate(credentials)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Provide credentials for ",(0,r.jsx)(s.code,{children:"HTTP authentication"}),"."]}),(0,r.jsx)(s.admonition,{type:"note",children:(0,r.jsx)(s.p,{children:"Request interception will be turned on behind the scenes to implement authentication. This might affect performance."})}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["To disable authentication, pass ",(0,r.jsx)(s.code,{children:"null"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"bringtofront",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.bringtofront",children:"bringToFront()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Brings page to front (activates tab)."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"browser",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.browser",children:"browser()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Get the browser the page belongs to."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"browsercontext",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.browsercontext",children:"browserContext()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Get the browser context that the page belongs to."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"click",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.click",children:"click(selector, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This method fetches an element with ",(0,r.jsx)(s.code,{children:"selector"}),", scrolls it into view if needed, and then uses ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page#mouse",children:"Page.mouse"})," to click in the center of the element. If there's no element matching ",(0,r.jsx)(s.code,{children:"selector"}),", the method throws an error."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Bear in mind that if ",(0,r.jsx)(s.code,{children:"click()"})," triggers a navigation event and there's a separate ",(0,r.jsx)(s.code,{children:"page.waitForNavigation()"})," promise to be resolved, you may end up with a race condition that yields unexpected results. The correct pattern for click and wait for navigation is the following:"]}),(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-ts",children:"const [response] = await Promise.all([\n page.waitForNavigation(waitOptions),\n page.click(selector, clickOptions),\n]);\n"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.click",children:"page.mainFrame().click(selector[, options])"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"close",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.close",children:"close(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"content",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.content",children:"content()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"The full HTML contents of the page, including the DOCTYPE."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"cookies",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.cookies",children:"cookies(urls)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"If no URLs are specified, this method returns cookies for the current page URL. If URLs are specified, only cookies for those URLs are returned."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"createcdpsession",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.createcdpsession",children:"createCDPSession()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Creates a Chrome Devtools Protocol session attached to the page."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"createpdfstream",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.createpdfstream",children:"createPDFStream(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Generates a PDF of the page with the ",(0,r.jsx)(s.code,{children:"print"})," CSS media type."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["To generate a PDF with the ",(0,r.jsx)(s.code,{children:"screen"})," media type, call ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatemediatype",children:"`page.emulateMediaType('screen')`"})," before calling ",(0,r.jsx)(s.code,{children:"page.pdf()"}),"."]}),(0,r.jsxs)(s.p,{children:["By default, ",(0,r.jsx)(s.code,{children:"page.pdf()"})," generates a pdf with modified colors for printing. Use the ",(0,r.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust",children:"`-webkit-print-color-adjust`"})," property to force rendering of exact colors."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"deletecookie",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.deletecookie",children:"deleteCookie(cookies)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulate",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulate",children:"emulate(device)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Emulates a given device's metrics and user agent."}),(0,r.jsxs)(s.p,{children:["To aid emulation, Puppeteer provides a list of known devices that can be via ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.knowndevices",children:"KnownDevices"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["This method is a shortcut for calling two methods: ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setuseragent",children:"Page.setUserAgent()"})," and ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setviewport",children:"Page.setViewport()"}),"."]}),(0,r.jsx)(s.p,{children:"This method will resize the page. A lot of websites don't expect phones to change size, so you should emulate before navigating to the page."})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulatecputhrottling",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatecputhrottling",children:"emulateCPUThrottling(factor)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Enables CPU throttling to emulate slow CPUs."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulateidlestate",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulateidlestate",children:"emulateIdleState(overrides)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Emulates the idle state. If no arguments set, clears idle state emulation."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulatemediafeatures",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatemediafeatures",children:"emulateMediaFeatures(features)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulatemediatype",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatemediatype",children:"emulateMediaType(type)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulatenetworkconditions",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatenetworkconditions",children:"emulateNetworkConditions(networkConditions)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This does not affect WebSockets and WebRTC PeerConnections (see ",(0,r.jsx)(s.a,{href:"https://crbug.com/563644",children:"https://crbug.com/563644"}),"). To set the page offline, you can use ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setofflinemode",children:"Page.setOfflineMode()"}),"."]}),(0,r.jsxs)(s.p,{children:["A list of predefined network conditions can be used by importing ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.predefinednetworkconditions",children:"PredefinedNetworkConditions"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulatetimezone",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatetimezone",children:"emulateTimezone(timezoneId)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"emulatevisiondeficiency",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatevisiondeficiency",children:"emulateVisionDeficiency(type)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Simulates the given vision deficiency on the page."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"evaluate",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.evaluate",children:"evaluate(pageFunction, args)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Evaluates a function in the page's context and returns the result."}),(0,r.jsxs)(s.p,{children:["If the function passed to ",(0,r.jsx)(s.code,{children:"page.evaluate"})," returns a Promise, the function will wait for the promise to resolve and return its value."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"evaluatehandle",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.evaluatehandle",children:"evaluateHandle(pageFunction, args)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["The only difference between ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.evaluate",children:"page.evaluate"})," and ",(0,r.jsx)(s.code,{children:"page.evaluateHandle"})," is that ",(0,r.jsx)(s.code,{children:"evaluateHandle"})," will return the value wrapped in an in-page object."]}),(0,r.jsxs)(s.p,{children:["If the function passed to ",(0,r.jsx)(s.code,{children:"page.evaluateHandle"})," returns a Promise, the function will wait for the promise to resolve and return its value."]}),(0,r.jsx)(s.p,{children:"You can pass a string instead of a function (although functions are recommended as they are easier to debug and use with TypeScript):"})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"evaluateonnewdocument",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.evaluateonnewdocument",children:"evaluateOnNewDocument(pageFunction, args)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Adds a function which would be invoked in one of the following scenarios:"}),(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:"whenever the page is navigated"}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:"whenever the child frame is attached or navigated. In this case, the function is invoked in the context of the newly attached frame."}),"\n"]}),"\n"]}),(0,r.jsxs)(s.p,{children:["The function is invoked after the document was created but before any of its scripts were run. This is useful to amend the JavaScript environment, e.g. to seed ",(0,r.jsx)(s.code,{children:"Math.random"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"exposefunction",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.exposefunction",children:"exposeFunction(name, pptrFunction)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["The method adds a function called ",(0,r.jsx)(s.code,{children:"name"})," on the page's ",(0,r.jsx)(s.code,{children:"window"})," object. When called, the function executes ",(0,r.jsx)(s.code,{children:"puppeteerFunction"})," in node.js and returns a ",(0,r.jsx)(s.code,{children:"Promise"})," which resolves to the return value of ",(0,r.jsx)(s.code,{children:"puppeteerFunction"}),"."]}),(0,r.jsxs)(s.p,{children:["If the puppeteerFunction returns a ",(0,r.jsx)(s.code,{children:"Promise"}),", it will be awaited."]}),(0,r.jsx)(s.admonition,{type:"note",children:(0,r.jsxs)(s.p,{children:["Functions installed via ",(0,r.jsx)(s.code,{children:"page.exposeFunction"})," survive navigations."]})})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"focus",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.focus",children:"focus(selector)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This method fetches an element with ",(0,r.jsx)(s.code,{children:"selector"})," and focuses it. If there's no element matching ",(0,r.jsx)(s.code,{children:"selector"}),", the method throws an error."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.focus",children:"page.mainFrame().focus(selector)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"frames",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.frames",children:"frames()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"An array of all frames attached to the page."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"getdefaulttimeout",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.getdefaulttimeout",children:"getDefaultTimeout()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Maximum time in milliseconds."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"goback",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.goback",children:"goBack(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"This method navigate to the previous page in history."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"goforward",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.goforward",children:"goForward(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"This method navigate to the next page in history."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"goto",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.goto",children:"goto(url, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Navigates the frame or page to the given ",(0,r.jsx)(s.code,{children:"url"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Navigation to ",(0,r.jsx)(s.code,{children:"about:blank"})," or navigation to the same URL with a different hash will succeed and return ",(0,r.jsx)(s.code,{children:"null"}),"."]}),(0,r.jsx)(s.admonition,{type:"warning",children:(0,r.jsxs)(s.p,{children:["Headless shell mode doesn't support navigation to a PDF document. See the ",(0,r.jsx)(s.a,{href:"https://crbug.com/761295",children:"upstream issue"}),"."]})}),(0,r.jsxs)(s.p,{children:['In headless shell, 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 ',(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httpresponse.status",children:"HTTPResponse.status()"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"hover",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.hover",children:"hover(selector)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This method fetches an element with ",(0,r.jsx)(s.code,{children:"selector"}),", scrolls it into view if needed, and then uses ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page#mouse",children:"Page.mouse"})," to hover over the center of the element. If there's no element matching ",(0,r.jsx)(s.code,{children:"selector"}),", the method throws an error."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.hover",children:"page.mainFrame().hover(selector)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"isclosed",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.isclosed",children:"isClosed()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Indicates that the page has been closed."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"isdraginterceptionenabled",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.isdraginterceptionenabled",children:"isDragInterceptionEnabled()"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"deprecated"})})}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"true"})," if drag events are being intercepted, ",(0,r.jsx)(s.code,{children:"false"})," otherwise."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Deprecated:"})}),(0,r.jsxs)(s.p,{children:["We no longer support intercepting drag payloads. Use the new drag APIs found on ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.elementhandle",children:"ElementHandle"})," to drag (or just use the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page#mouse",children:"Page.mouse"}),")."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"isjavascriptenabled",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.isjavascriptenabled",children:"isJavaScriptEnabled()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"true"})," if the page has JavaScript enabled, ",(0,r.jsx)(s.code,{children:"false"})," otherwise."]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"isserviceworkerbypassed",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.isserviceworkerbypassed",children:"isServiceWorkerBypassed()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"true"})," if the service worker are being bypassed, ",(0,r.jsx)(s.code,{children:"false"})," otherwise."]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"locator",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.locator",children:"locator(selector)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Creates a locator for the provided selector. See ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.locator",children:"Locator"})," for details and supported actions."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"Locators API is experimental and we will not follow semver for breaking change in the Locators API."})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"locator",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.locator_1",children:"locator(func)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Creates a locator for the provided function. See ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.locator",children:"Locator"})," for details and supported actions."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"Locators API is experimental and we will not follow semver for breaking change in the Locators API."})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"mainframe",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.mainframe",children:"mainFrame()"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"The page's main frame."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"metrics",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.metrics",children:"metrics()"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Object containing metrics as key/value pairs."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"All timestamps are in monotonic time: monotonically increasing time in seconds since an arbitrary point in the past."})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"pdf",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.pdf",children:"pdf(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Generates a PDF of the page with the ",(0,r.jsx)(s.code,{children:"print"})," CSS media type."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["To generate a PDF with the ",(0,r.jsx)(s.code,{children:"screen"})," media type, call ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatemediatype",children:"`page.emulateMediaType('screen')`"})," before calling ",(0,r.jsx)(s.code,{children:"page.pdf()"}),"."]}),(0,r.jsxs)(s.p,{children:["By default, ",(0,r.jsx)(s.code,{children:"page.pdf()"})," generates a pdf with modified colors for printing. Use the ",(0,r.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust",children:"`-webkit-print-color-adjust`"})," property to force rendering of exact colors."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"queryobjects",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.queryobjects",children:"queryObjects(prototypeHandle)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"This method iterates the JavaScript heap and finds all objects with the given prototype."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"reload",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.reload",children:"reload(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Reloads the page."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"removeexposedfunction",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.removeexposedfunction",children:"removeExposedFunction(name)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsxs)(s.p,{children:["The method removes a previously added function via $",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.exposefunction",children:"Page.exposeFunction()"})," called ",(0,r.jsx)(s.code,{children:"name"})," from the page's ",(0,r.jsx)(s.code,{children:"window"})," object."]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"removescripttoevaluateonnewdocument",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.removescripttoevaluateonnewdocument",children:"removeScriptToEvaluateOnNewDocument(identifier)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Removes script that injected into page by Page.evaluateOnNewDocument."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"screencast",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.screencast",children:"screencast(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.em,{children:"(Experimental)"})})," Captures a screencast of this ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page",children:"page"}),"."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["All recordings will be ",(0,r.jsx)(s.a,{href:"https://www.webmproject.org/",children:"WebM"})," format using the ",(0,r.jsx)(s.a,{href:"https://www.webmproject.org/vp9/",children:"VP9"})," video codec. The FPS is 30."]}),(0,r.jsxs)(s.p,{children:["You must have ",(0,r.jsx)(s.a,{href:"https://ffmpeg.org/",children:"ffmpeg"})," installed on your system."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"screenshot",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.screenshot",children:"screenshot(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsxs)(s.p,{children:["Captures a screenshot of this ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page",children:"page"}),"."]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"screenshot",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.screenshot_1",children:"screenshot(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"select",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.select",children:"select(selector, values)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Triggers a ",(0,r.jsx)(s.code,{children:"change"})," and ",(0,r.jsx)(s.code,{children:"input"})," event once all the provided options have been selected. If there's no ",(0,r.jsx)(s.code,{children:"<select>"})," element matching ",(0,r.jsx)(s.code,{children:"selector"}),", the method throws an error."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.select",children:"page.mainFrame().select()"})]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setbypasscsp",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setbypasscsp",children:"setBypassCSP(enabled)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Toggles bypassing page's Content-Security-Policy."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["NOTE: CSP bypassing happens at the moment of CSP initialization rather than evaluation. Usually, this means that ",(0,r.jsx)(s.code,{children:"page.setBypassCSP"})," should be called before navigating to the domain."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setbypassserviceworker",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setbypassserviceworker",children:"setBypassServiceWorker(bypass)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Toggles ignoring of service worker for each request."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setcacheenabled",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setcacheenabled",children:"setCacheEnabled(enabled)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Toggles ignoring cache for each request based on the enabled state. By default, caching is enabled."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setcontent",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setcontent",children:"setContent(html, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Set the content of the page."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setcookie",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setcookie",children:"setCookie(cookies)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setdefaultnavigationtimeout",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setdefaultnavigationtimeout",children:"setDefaultNavigationTimeout(timeout)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"This setting will change the default maximum navigation time for the following methods and related shortcuts:"}),(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.goback",children:"page.goBack(options)"})}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.goforward",children:"page.goForward(options)"})}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.goto",children:"page.goto(url,options)"})}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.reload",children:"page.reload(options)"})}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setcontent",children:"page.setContent(html,options)"})}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitfornavigation",children:"page.waitForNavigation(options)"})}),"\n"]}),"\n"]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setdefaulttimeout",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setdefaulttimeout",children:"setDefaultTimeout(timeout)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setdraginterception",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setdraginterception",children:"setDragInterception(enabled)"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"deprecated"})})}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Deprecated:"})}),(0,r.jsxs)(s.p,{children:["We no longer support intercepting drag payloads. Use the new drag APIs found on ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.elementhandle",children:"ElementHandle"})," to drag (or just use the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page#mouse",children:"Page.mouse"}),")."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setextrahttpheaders",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setextrahttpheaders",children:"setExtraHTTPHeaders(headers)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"The extra HTTP headers will be sent with every request the page initiates."}),(0,r.jsx)(s.admonition,{type:"tip",children:(0,r.jsx)(s.p,{children:"All HTTP header names are lowercased. (HTTP headers are case-insensitive, so this shouldn\u2019t impact your server code.)"})}),(0,r.jsx)(s.admonition,{type:"note",children:(0,r.jsx)(s.p,{children:"page.setExtraHTTPHeaders does not guarantee the order of headers in the outgoing requests."})})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setgeolocation",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setgeolocation",children:"setGeolocation(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Sets the page's geolocation."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Consider using ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.browsercontext.overridepermissions",children:"BrowserContext.overridePermissions()"})," to grant permissions for the page to read its geolocation."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setjavascriptenabled",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setjavascriptenabled",children:"setJavaScriptEnabled(enabled)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"NOTE: changing this value won't affect scripts that have already been run. It will take full effect on the next navigation."})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setofflinemode",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setofflinemode",children:"setOfflineMode(enabled)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Sets the network connection to offline."}),(0,r.jsxs)(s.p,{children:["It does not change the parameters used in ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.emulatenetworkconditions",children:"Page.emulateNetworkConditions()"})]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setrequestinterception",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setrequestinterception",children:"setRequestInterception(value)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Activating request interception enables ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httprequest.abort",children:"HTTPRequest.abort()"}),", ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httprequest.continue",children:"HTTPRequest.continue()"})," and ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.httprequest.respond",children:"HTTPRequest.respond()"})," methods. This provides the capability to modify network requests that are made by a page."]}),(0,r.jsx)(s.p,{children:"Once request interception is enabled, every request will stall unless it's continued, responded or aborted; or completed using the browser cache."}),(0,r.jsxs)(s.p,{children:["See the ",(0,r.jsx)(s.a,{href:"https://pptr.dev/guides/network-interception",children:"Request interception guide"})," for more details."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setuseragent",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setuseragent",children:"setUserAgent(userAgent, userAgentMetadata)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"setviewport",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setviewport",children:"setViewport(viewport)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"page.setViewport"})," will resize the page. A lot of websites don't expect phones to change size, so you should set the viewport before navigating to the page."]}),(0,r.jsx)(s.p,{children:"In the case of multiple pages in a single browser, each page can have its own viewport size."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"NOTE: in certain cases, setting viewport will reload the page in order to set the isMobile or hasTouch properties."})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"tap",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.tap",children:"tap(selector)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["This method fetches an element with ",(0,r.jsx)(s.code,{children:"selector"}),", scrolls it into view if needed, and then uses ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page#touchscreen",children:"Page.touchscreen"})," to tap in the center of the element. If there's no element matching ",(0,r.jsx)(s.code,{children:"selector"}),", the method throws an error."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.tap",children:"page.mainFrame().tap(selector)"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"target",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.target",children:"target()"})})}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:(0,r.jsx)(s.code,{children:"deprecated"})})}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"A target this page was created from."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Deprecated:"})}),(0,r.jsxs)(s.p,{children:["Use ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.createcdpsession",children:"Page.createCDPSession()"})," directly."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"title",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.title",children:"title()"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"The page's title"}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.title",children:"page.mainFrame().title()"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"type",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.type",children:"type(selector, text, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Sends a ",(0,r.jsx)(s.code,{children:"keydown"}),", ",(0,r.jsx)(s.code,{children:"keypress/input"}),", and ",(0,r.jsx)(s.code,{children:"keyup"})," event for each character in the text."]}),(0,r.jsxs)(s.p,{children:["To press a special key, like ",(0,r.jsx)(s.code,{children:"Control"})," or ",(0,r.jsx)(s.code,{children:"ArrowDown"}),", use ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.keyboard.press",children:"Keyboard.press()"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"url",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.url",children:"url()"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"The page's URL."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Shortcut for ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.frame.url",children:"page.mainFrame().url()"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"viewport",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.viewport",children:"viewport()"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Returns the current page viewport settings without checking the actual page viewport."}),(0,r.jsxs)(s.p,{children:["This is either the viewport set with the previous ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setviewport",children:"Page.setViewport()"})," call or the default viewport set via ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.browserconnectoptions#defaultviewport",children:"BrowserConnectOptions.defaultViewport"}),"."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitfordeviceprompt",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitfordeviceprompt",children:"waitForDevicePrompt(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth."}),(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsx)(s.p,{children:"This must be called before the device request is made. It will not return a currently active device prompt."})})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitforfilechooser",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitforfilechooser",children:"waitForFileChooser(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"This method is typically coupled with an action that triggers file choosing."}),(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsx)(s.p,{children:"This must be called before the file chooser is launched. It will not return a currently active file chooser."})}),(0,r.jsx)(s.admonition,{type:"caution",children:(0,r.jsx)(s.p,{children:"Interception of file dialogs triggered via DOM APIs such as window.showOpenFilePicker is currently not supported."})}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:['In the "headful" browser, this method results in the native file picker dialog ',(0,r.jsx)(s.code,{children:"not showing up"})," for the user."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitforframe",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitforframe",children:"waitForFrame(urlOrPredicate, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Waits for a frame matching the given conditions to appear."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitforfunction",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitforfunction",children:"waitForFunction(pageFunction, options, args)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsxs)(s.p,{children:["Waits for the provided function, ",(0,r.jsx)(s.code,{children:"pageFunction"}),", to return a truthy value when evaluated in the page's context."]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitfornavigation",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitfornavigation",children:"waitForNavigation(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:"Waits for the page to navigate to a new URL or to reload. It is useful when you run code that will indirectly cause the page to navigate."}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["Usage of the ",(0,r.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/History_API",children:"History API"})," to change the URL is considered a navigation."]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitfornetworkidle",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitfornetworkidle",children:"waitForNetworkIdle(options)"})})}),(0,r.jsx)("td",{}),(0,r.jsx)("td",{children:(0,r.jsx)(s.p,{children:"Waits for the network to be idle."})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitforrequest",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitforrequest",children:"waitForRequest(urlOrPredicate, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"Optional Waiting Parameters have:"}),(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"timeout"}),": Maximum wait time in milliseconds, defaults to ",(0,r.jsx)(s.code,{children:"30"})," seconds, pass ",(0,r.jsx)(s.code,{children:"0"})," to disable the timeout. The default value can be changed by using the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setdefaulttimeout",children:"Page.setDefaultTimeout()"})," method."]}),"\n"]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitforresponse",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitforresponse",children:"waitForResponse(urlOrPredicate, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"Optional Parameter have:"}),(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"timeout"}),": Maximum wait time in milliseconds, defaults to ",(0,r.jsx)(s.code,{children:"30"})," seconds, pass ",(0,r.jsx)(s.code,{children:"0"})," to disable the timeout. The default value can be changed by using the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setdefaulttimeout",children:"Page.setDefaultTimeout()"})," method."]}),"\n"]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"waitforselector",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.waitforselector",children:"waitForSelector(selector, options)"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["Wait for the ",(0,r.jsx)(s.code,{children:"selector"})," to appear in page. If at the moment of calling the method the ",(0,r.jsx)(s.code,{children:"selector"})," already exists, the method will return immediately. If the ",(0,r.jsx)(s.code,{children:"selector"})," doesn't appear after the ",(0,r.jsx)(s.code,{children:"timeout"})," milliseconds of waiting, the function will throw."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsxs)(s.p,{children:["The optional Parameter in Arguments ",(0,r.jsx)(s.code,{children:"options"})," are:"]}),(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"visible"}),": A boolean wait for element to be present in DOM and to be visible, i.e. to not have ",(0,r.jsx)(s.code,{children:"display: none"})," or ",(0,r.jsx)(s.code,{children:"visibility: hidden"})," CSS properties. Defaults to ",(0,r.jsx)(s.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"hidden"}),": Wait for element to not be found in the DOM or to be hidden, i.e. have ",(0,r.jsx)(s.code,{children:"display: none"})," or ",(0,r.jsx)(s.code,{children:"visibility: hidden"})," CSS properties. Defaults to ",(0,r.jsx)(s.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(s.li,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.code,{children:"timeout"}),": maximum time to wait for in milliseconds. Defaults to ",(0,r.jsx)(s.code,{children:"30000"})," (30 seconds). Pass ",(0,r.jsx)(s.code,{children:"0"})," to disable timeout. The default value can be changed by using the ",(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.setdefaulttimeout",children:"Page.setDefaultTimeout()"})," method."]}),"\n"]}),"\n"]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)("span",{id:"workers",children:(0,r.jsx)(s.a,{href:"/next/api/puppeteer.page.workers",children:"workers()"})})}),(0,r.jsx)("td",{}),(0,r.jsxs)("td",{children:[(0,r.jsxs)(s.p,{children:["All of the dedicated ",(0,r.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API",children:"WebWorkers"})," associated with the page."]}),(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Remarks:"})}),(0,r.jsx)(s.p,{children:"This does not contain ServiceWorkers"})]})]})]})]})]})}function p(e={}){const{wrapper:s}={...(0,n.a)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},75251:(e,s,t)=>{var r=t(67294),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,s,t){var r,i={},l=null,h=null;for(r in void 0!==t&&(l=""+t),void 0!==s.key&&(l=""+s.key),void 0!==s.ref&&(h=s.ref),s)d.call(s,r)&&!c.hasOwnProperty(r)&&(i[r]=s[r]);if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:n,type:e,key:l,ref:h,props:i,_owner:a.current}}s.Fragment=i,s.jsx=l,s.jsxs=l},85893:(e,s,t)=>{e.exports=t(75251)},11151:(e,s,t)=>{t.d(s,{Z:()=>a,a:()=>d});var r=t(67294);const n={},i=r.createContext(n);function d(e){const s=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:d(e.components),r.createElement(i.Provider,{value:s},e.children)}}}]);