puppeteer/assets/js/85b4681f.21ac1406.js
release-please[bot] d321f9557a deploy: 8c0ac61260
2023-12-06 08:09:55 +00:00

2 lines
39 KiB
JavaScript

/*! For license information please see 85b4681f.21ac1406.js.LICENSE.txt */
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[46087],{53517:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>d,default:()=>o,frontMatter:()=>n,metadata:()=>a,toc:()=>h});var s=r(85893),i=r(11151);const n={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/versioned_docs/version-21.6.0/api/puppeteer.page.md",sourceDirName:"api",slug:"/api/puppeteer.page",permalink:"/api/puppeteer.page",draft:!1,unlisted:!1,tags:[],version:"21.6.0",frontMatter:{sidebar_label:"Page"},sidebar:"api",previous:{title:"BrowserContext.waitForTarget",permalink:"/api/puppeteer.browsercontext.waitfortarget"},next:{title:"Page.$",permalink:"/api/puppeteer.page._"}},c={},h=[{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 p(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h4:"h4",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"page-class",children:"Page class"}),"\n",(0,s.jsxs)(t.p,{children:["Page provides methods to interact with a single tab or ",(0,s.jsx)(t.a,{href:"https://developer.chrome.com/extensions/background_pages",children:"extension background page"})," in the browser."]}),"\n",(0,s.jsx)(t.admonition,{type:"note",children:(0,s.jsx)(t.p,{children:"One Browser instance might have multiple Page instances."})}),"\n",(0,s.jsx)(t.h4,{id:"signature",children:"Signature:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-typescript",children:"export declare abstract class Page extends EventEmitter<PageEvents>\n"})}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Extends:"})," ",(0,s.jsx)(t.a,{href:"/api/puppeteer.eventemitter",children:"EventEmitter"}),"<",(0,s.jsx)(t.a,{href:"/api/puppeteer.pageevents",children:"PageEvents"}),">"]}),"\n",(0,s.jsx)(t.h2,{id:"remarks",children:"Remarks"}),"\n",(0,s.jsxs)(t.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,s.jsx)(t.code,{children:"Page"})," class."]}),"\n",(0,s.jsx)(t.h2,{id:"example-1",children:"Example 1"}),"\n",(0,s.jsx)(t.p,{children:"This example creates a page, navigates it to a URL, and then saves a screenshot:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.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,s.jsxs)(t.p,{children:["The Page class extends from Puppeteer's ",(0,s.jsx)(t.a,{href:"/api/puppeteer.eventemitter",children:"EventEmitter"})," class and will emit various events which are documented in the ",(0,s.jsx)(t.a,{href:"/api/puppeteer.pageevent",children:"PageEvent"})," enum."]}),"\n",(0,s.jsx)(t.h2,{id:"example-2",children:"Example 2"}),"\n",(0,s.jsxs)(t.p,{children:["This example logs a message for a single page ",(0,s.jsx)(t.code,{children:"load"})," event:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"page.once('load', () => console.log('Page loaded!'));\n"})}),"\n",(0,s.jsxs)(t.p,{children:["To unsubscribe from events use the ",(0,s.jsx)(t.a,{href:"/api/puppeteer.eventemitter.off",children:"EventEmitter.off()"})," method:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.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,s.jsx)(t.h2,{id:"properties",children:"Properties"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Property"}),(0,s.jsx)(t.th,{children:"Modifiers"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"accessibility"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:"readonly"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.accessibility",children:"Accessibility"})}),(0,s.jsxs)(t.td,{children:["The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as ",(0,s.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Screen_reader",children:"screen readers"})," or ",(0,s.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Switch_access",children:"switches"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"coverage"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:"readonly"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.coverage",children:"Coverage"})}),(0,s.jsx)(t.td,{children:"The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"keyboard"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:"readonly"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.keyboard",children:"Keyboard"})}),(0,s.jsxs)(t.td,{children:["Keyboard provides an api for managing a virtual keyboard. The high level api is ",(0,s.jsx)(t.a,{href:"/api/puppeteer.keyboard.type",children:"Keyboard.type()"}),", which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"mouse"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:"readonly"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.mouse",children:"Mouse"})}),(0,s.jsx)(t.td,{children:"The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"touchscreen"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:"readonly"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.touchscreen",children:"Touchscreen"})}),(0,s.jsx)(t.td,{children:"The Touchscreen class exposes touchscreen events."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"tracing"}),(0,s.jsx)(t.td,{children:(0,s.jsx)("code",{children:"readonly"})}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.tracing",children:"Tracing"})}),(0,s.jsx)(t.td,{children:"The Tracing class exposes the tracing audit interface."})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"methods",children:"Methods"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Method"}),(0,s.jsx)(t.th,{children:"Modifiers"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page._",children:"$(selector)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Runs ",(0,s.jsx)("code",{children:"document.querySelector"})," within the page. If no element matches the selector, the return value resolves to ",(0,s.jsx)("code",{children:"null"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.__",children:"$$(selector)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["The method runs ",(0,s.jsx)("code",{children:"document.querySelectorAll"})," within the page. If no elements match the selector, the return value resolves to ",(0,s.jsx)("code",{children:"[]"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.__eval",children:"$$eval(selector, pageFunction, args)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["This method runs ",(0,s.jsx)("code",{children:"Array.from(document.querySelectorAll(selector))"})," within the page and passes the result as the first argument to the ",(0,s.jsx)("code",{children:"pageFunction"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page._eval",children:"$eval(selector, pageFunction, args)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["This method runs ",(0,s.jsx)("code",{children:"document.querySelector"})," within the page and passes the result as the first argument to the ",(0,s.jsx)("code",{children:"pageFunction"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page._x",children:"$x(expression)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"The method evaluates the XPath expression relative to the page document as its context node. If there are no such elements, the method resolves to an empty array."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.addscripttag",children:"addScriptTag(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Adds a ",(0,s.jsx)("code",{children:"<script>"})," tag into the page with the desired URL or content."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.addstyletag",children:"addStyleTag(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsxs)("p",{children:["Adds a ",(0,s.jsx)("code",{children:'<link rel="stylesheet">'})," tag into the page with the desired URL or a ",(0,s.jsx)("code",{children:'<style type="text/css">'})," tag with the content."]}),(0,s.jsxs)("p",{children:["Shortcut for ",(0,s.jsx)(t.a,{href:"/api/puppeteer.frame.addstyletag_1",children:"page.mainFrame().addStyleTag(options)"}),"."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.addstyletag_1",children:"addStyleTag(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.authenticate",children:"authenticate(credentials)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Provide credentials for ",(0,s.jsx)("code",{children:"HTTP authentication"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.bringtofront",children:"bringToFront()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Brings page to front (activates tab)."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.browser",children:"browser()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Get the browser the page belongs to."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.browsercontext",children:"browserContext()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Get the browser context that the page belongs to."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.click",children:"click(selector, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["This method fetches an element with ",(0,s.jsx)("code",{children:"selector"}),", scrolls it into view if needed, and then uses ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page",children:"Page.mouse"})," to click in the center of the element. If there's no element matching ",(0,s.jsx)("code",{children:"selector"}),", the method throws an error."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.close",children:"close(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.content",children:"content()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"The full HTML contents of the page, including the DOCTYPE."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.cookies",children:"cookies(urls)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{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,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.createcdpsession",children:"createCDPSession()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Creates a Chrome Devtools Protocol session attached to the page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.createpdfstream",children:"createPDFStream(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Generates a PDF of the page with the ",(0,s.jsx)("code",{children:"print"})," CSS media type."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.deletecookie",children:"deleteCookie(cookies)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulate",children:"emulate(device)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"Emulates a given device's metrics and user agent."}),(0,s.jsxs)("p",{children:["To aid emulation, Puppeteer provides a list of known devices that can be via ",(0,s.jsx)(t.a,{href:"/api/puppeteer.knowndevices",children:"KnownDevices"}),"."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatecputhrottling",children:"emulateCPUThrottling(factor)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Enables CPU throttling to emulate slow CPUs."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulateidlestate",children:"emulateIdleState(overrides)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Emulates the idle state. If no arguments set, clears idle state emulation."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatemediafeatures",children:"emulateMediaFeatures(features)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatemediatype",children:"emulateMediaType(type)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatenetworkconditions",children:"emulateNetworkConditions(networkConditions)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsxs)("p",{children:["This does not affect WebSockets and WebRTC PeerConnections (see ",(0,s.jsx)(t.a,{href:"https://crbug.com/563644",children:"https://crbug.com/563644"}),"). To set the page offline, you can use ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setofflinemode",children:"Page.setOfflineMode()"}),"."]}),(0,s.jsxs)("p",{children:["A list of predefined network conditions can be used by importing ",(0,s.jsx)(t.a,{href:"/api/puppeteer.predefinednetworkconditions",children:"PredefinedNetworkConditions"}),"."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatetimezone",children:"emulateTimezone(timezoneId)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatevisiondeficiency",children:"emulateVisionDeficiency(type)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Simulates the given vision deficiency on the page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.evaluate",children:"evaluate(pageFunction, args)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"Evaluates a function in the page's context and returns the result."}),(0,s.jsxs)("p",{children:["If the function passed to ",(0,s.jsx)("code",{children:"page.evaluate"})," returns a Promise, the function will wait for the promise to resolve and return its value."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.evaluatehandle",children:"evaluateHandle(pageFunction, args)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.evaluateonnewdocument",children:"evaluateOnNewDocument(pageFunction, args)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"Adds a function which would be invoked in one of the following scenarios:"}),(0,s.jsx)("p",{children:"- whenever the page is navigated"}),(0,s.jsx)("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."}),(0,s.jsxs)("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,s.jsx)("code",{children:"Math.random"}),"."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.exposefunction",children:"exposeFunction(name, pptrFunction)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsxs)("p",{children:["The method adds a function called ",(0,s.jsx)("code",{children:"name"})," on the page's ",(0,s.jsx)("code",{children:"window"})," object. When called, the function executes ",(0,s.jsx)("code",{children:"puppeteerFunction"})," in node.js and returns a ",(0,s.jsx)("code",{children:"Promise"})," which resolves to the return value of ",(0,s.jsx)("code",{children:"puppeteerFunction"}),"."]}),(0,s.jsxs)("p",{children:["If the puppeteerFunction returns a ",(0,s.jsx)("code",{children:"Promise"}),", it will be awaited."]}),(0,s.jsx)("p",{children:":::note"}),(0,s.jsxs)("p",{children:["Functions installed via ",(0,s.jsx)("code",{children:"page.exposeFunction"})," survive navigations."]}),(0,s.jsx)("p",{children:":::note"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.focus",children:"focus(selector)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["This method fetches an element with ",(0,s.jsx)("code",{children:"selector"})," and focuses it. If there's no element matching ",(0,s.jsx)("code",{children:"selector"}),", the method throws an error."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.frames",children:"frames()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"An array of all frames attached to the page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.getdefaulttimeout",children:"getDefaultTimeout()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Maximum time in milliseconds."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.goback",children:"goBack(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"This method navigate to the previous page in history."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.goforward",children:"goForward(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"This method navigate to the next page in history."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.goto",children:"goto(url, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Navigates the page to the given ",(0,s.jsx)("code",{children:"url"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.hover",children:"hover(selector)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["This method fetches an element with ",(0,s.jsx)("code",{children:"selector"}),", scrolls it into view if needed, and then uses ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page",children:"Page.mouse"})," to hover over the center of the element. If there's no element matching ",(0,s.jsx)("code",{children:"selector"}),", the method throws an error."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.isclosed",children:"isClosed()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Indicates that the page has been closed."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.isdraginterceptionenabled",children:"isDragInterceptionEnabled()"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("code",{children:"true"})," if drag events are being intercepted, ",(0,s.jsx)("code",{children:"false"})," otherwise."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.isjavascriptenabled",children:"isJavaScriptEnabled()"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("code",{children:"true"})," if the page has JavaScript enabled, ",(0,s.jsx)("code",{children:"false"})," otherwise."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.isserviceworkerbypassed",children:"isServiceWorkerBypassed()"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("code",{children:"true"})," if the service worker are being bypassed, ",(0,s.jsx)("code",{children:"false"})," otherwise."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.locator",children:"locator(selector)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Creates a locator for the provided selector. See ",(0,s.jsx)(t.a,{href:"/api/puppeteer.locator",children:"Locator"})," for details and supported actions."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.locator_1",children:"locator(func)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Creates a locator for the provided function. See ",(0,s.jsx)(t.a,{href:"/api/puppeteer.locator",children:"Locator"})," for details and supported actions."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.mainframe",children:"mainFrame()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"The page's main frame."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.metrics",children:"metrics()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Object containing metrics as key/value pairs."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.pdf",children:"pdf(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Generates a PDF of the page with the ",(0,s.jsx)("code",{children:"print"})," CSS media type."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.queryobjects",children:"queryObjects(prototypeHandle)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"This method iterates the JavaScript heap and finds all objects with the given prototype."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.reload",children:"reload(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Reloads the page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.removeexposedfunction",children:"removeExposedFunction(name)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["The method removes a previously added function via $",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.exposefunction",children:"Page.exposeFunction()"})," called ",(0,s.jsx)("code",{children:"name"})," from the page's ",(0,s.jsx)("code",{children:"window"})," object."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.removescripttoevaluateonnewdocument",children:"removeScriptToEvaluateOnNewDocument(identifier)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Removes script that injected into page by Page.evaluateOnNewDocument."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.screencast",children:"screencast(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Captures a screencast of this ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page",children:"page"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.screenshot",children:"screenshot(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Captures a screenshot of this ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page",children:"page"}),"."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.screenshot_1",children:"screenshot(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.select",children:"select(selector, values)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Triggers a ",(0,s.jsx)("code",{children:"change"})," and ",(0,s.jsx)("code",{children:"input"})," event once all the provided options have been selected. If there's no ",(0,s.jsx)("code",{children:"<select>"})," element matching ",(0,s.jsx)("code",{children:"selector"}),", the method throws an error."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setbypasscsp",children:"setBypassCSP(enabled)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Toggles bypassing page's Content-Security-Policy."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setbypassserviceworker",children:"setBypassServiceWorker(bypass)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Toggles ignoring of service worker for each request."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setcacheenabled",children:"setCacheEnabled(enabled)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Toggles ignoring cache for each request based on the enabled state. By default, caching is enabled."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setcontent",children:"setContent(html, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Set the content of the page."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setcookie",children:"setCookie(cookies)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setdefaultnavigationtimeout",children:"setDefaultNavigationTimeout(timeout)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"This setting will change the default maximum navigation time for the following methods and related shortcuts:"}),(0,s.jsxs)("p",{children:["- ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.goback",children:"page.goBack(options)"})]}),(0,s.jsxs)("p",{children:["- ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.goforward",children:"page.goForward(options)"})]}),(0,s.jsxs)("p",{children:["- ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.goto",children:"page.goto(url,options)"})]}),(0,s.jsxs)("p",{children:["- ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.reload",children:"page.reload(options)"})]}),(0,s.jsxs)("p",{children:["- ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setcontent",children:"page.setContent(html,options)"})]}),(0,s.jsxs)("p",{children:["- ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitfornavigation",children:"page.waitForNavigation(options)"})]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setdefaulttimeout",children:"setDefaultTimeout(timeout)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setdraginterception",children:"setDragInterception(enabled)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setextrahttpheaders",children:"setExtraHTTPHeaders(headers)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"The extra HTTP headers will be sent with every request the page initiates."}),(0,s.jsx)("p",{children:":::tip"}),(0,s.jsx)("p",{children:"All HTTP header names are lowercased. (HTTP headers are case-insensitive, so this shouldn\u2019t impact your server code.)"}),(0,s.jsx)("p",{children:":::"}),(0,s.jsx)("p",{children:":::note"}),(0,s.jsx)("p",{children:"page.setExtraHTTPHeaders does not guarantee the order of headers in the outgoing requests."}),(0,s.jsx)("p",{children:":::"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setgeolocation",children:"setGeolocation(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Sets the page's geolocation."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setjavascriptenabled",children:"setJavaScriptEnabled(enabled)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setofflinemode",children:"setOfflineMode(enabled)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"Sets the network connection to offline."}),(0,s.jsxs)("p",{children:["It does not change the parameters used in ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.emulatenetworkconditions",children:"Page.emulateNetworkConditions()"})]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setrequestinterception",children:"setRequestInterception(value)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsxs)("p",{children:["Activating request interception enables ",(0,s.jsx)(t.a,{href:"/api/puppeteer.httprequest.abort",children:"HTTPRequest.abort()"}),", ",(0,s.jsx)(t.a,{href:"/api/puppeteer.httprequest.continue",children:"HTTPRequest.continue()"})," and ",(0,s.jsx)(t.a,{href:"/api/puppeteer.httprequest.respond",children:"HTTPRequest.respond()"})," methods. This provides the capability to modify network requests that are made by a page."]}),(0,s.jsx)("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,s.jsxs)("p",{children:["See the ",(0,s.jsx)(t.a,{href:"https://pptr.dev/next/guides/request-interception",children:"Request interception guide"})," for more details."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setuseragent",children:"setUserAgent(userAgent, userAgentMetadata)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setviewport",children:"setViewport(viewport)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("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,s.jsx)("p",{children:"In the case of multiple pages in a single browser, each page can have its own viewport size."})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.tap",children:"tap(selector)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["This method fetches an element with ",(0,s.jsx)("code",{children:"selector"}),", scrolls it into view if needed, and then uses ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page",children:"Page.touchscreen"})," to tap in the center of the element. If there's no element matching ",(0,s.jsx)("code",{children:"selector"}),", the method throws an error."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.target",children:"target()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"A target this page was created from."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.title",children:"title()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"The page's title"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.type",children:"type(selector, text, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsxs)("p",{children:["Sends a ",(0,s.jsx)("code",{children:"keydown"}),", ",(0,s.jsx)("code",{children:"keypress/input"}),", and ",(0,s.jsx)("code",{children:"keyup"})," event for each character in the text."]}),(0,s.jsxs)("p",{children:["To press a special key, like ",(0,s.jsx)("code",{children:"Control"})," or ",(0,s.jsx)("code",{children:"ArrowDown"}),", use ",(0,s.jsx)(t.a,{href:"/api/puppeteer.keyboard.press",children:"Keyboard.press()"}),"."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.url",children:"url()"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"The page's URL."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.viewport",children:"viewport()"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"Returns the current page viewport settings without checking the actual page viewport."}),(0,s.jsxs)("p",{children:["This is either the viewport set with the previous ",(0,s.jsx)(t.a,{href:"/api/puppeteer.page.setviewport",children:"Page.setViewport()"})," call or the default viewport set via ",(0,s.jsx)(t.a,{href:"./puppeteer.browserconnectoptions.defaultviewport.md",children:"BrowserConnectOptions.defaultViewport"}),"."]})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitfordeviceprompt",children:"waitForDevicePrompt(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"This method is typically coupled with an action that triggers a device request from an api such as WebBluetooth."}),(0,s.jsx)("p",{children:":::caution"}),(0,s.jsx)("p",{children:"This must be called before the device request is made. It will not return a currently active device prompt."}),(0,s.jsx)("p",{children:":::"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforfilechooser",children:"waitForFileChooser(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:[(0,s.jsx)("p",{children:"This method is typically coupled with an action that triggers file choosing."}),(0,s.jsx)("p",{children:":::caution"}),(0,s.jsx)("p",{children:"This must be called before the file chooser is launched. It will not return a currently active file chooser."}),(0,s.jsx)("p",{children:":::"})]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforframe",children:"waitForFrame(urlOrPredicate, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Waits for a frame matching the given conditions to appear."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforfunction",children:"waitForFunction(pageFunction, options, args)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{children:"Waits for a function to finish evaluating in the page's context."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitfornavigation",children:"waitForNavigation(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{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,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitfornetworkidle",children:"waitForNetworkIdle(options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforrequest",children:"waitForRequest(urlOrPredicate, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforresponse",children:"waitForResponse(urlOrPredicate, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforselector",children:"waitForSelector(selector, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Wait for the ",(0,s.jsx)("code",{children:"selector"})," to appear in page. If at the moment of calling the method the ",(0,s.jsx)("code",{children:"selector"})," already exists, the method will return immediately. If the ",(0,s.jsx)("code",{children:"selector"})," doesn't appear after the ",(0,s.jsx)("code",{children:"timeout"})," milliseconds of waiting, the function will throw."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitfortimeout",children:"waitForTimeout(milliseconds)"})}),(0,s.jsx)(t.td,{}),(0,s.jsx)(t.td,{})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.waitforxpath",children:"waitForXPath(xpath, options)"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["Wait for the ",(0,s.jsx)("code",{children:"xpath"})," to appear in page. If at the moment of calling the method the ",(0,s.jsx)("code",{children:"xpath"})," already exists, the method will return immediately. If the ",(0,s.jsx)("code",{children:"xpath"})," doesn't appear after the ",(0,s.jsx)("code",{children:"timeout"})," milliseconds of waiting, the function will throw."]})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.a,{href:"/api/puppeteer.page.workers",children:"workers()"})}),(0,s.jsx)(t.td,{}),(0,s.jsxs)(t.td,{children:["All of the dedicated ",(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API",children:"WebWorkers"})," associated with the page."]})]})]})]})]})}function o(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},75251:(e,t,r)=>{var s=r(67294),i=Symbol.for("react.element"),n=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,a=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(e,t,r){var s,n={},h=null,p=null;for(s in void 0!==r&&(h=""+r),void 0!==t.key&&(h=""+t.key),void 0!==t.ref&&(p=t.ref),t)d.call(t,s)&&!c.hasOwnProperty(s)&&(n[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===n[s]&&(n[s]=t[s]);return{$$typeof:i,type:e,key:h,ref:p,props:n,_owner:a.current}}t.Fragment=n,t.jsx=h,t.jsxs=h},85893:(e,t,r)=>{e.exports=r(75251)},11151:(e,t,r)=>{r.d(t,{Z:()=>a,a:()=>d});var s=r(67294);const i={},n=s.createContext(i);function d(e){const t=s.useContext(n);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:d(e.components),s.createElement(n.Provider,{value:t},e.children)}}}]);