The method runs document.querySelectorAll within the frame. If no elements match the selector, the return value resolve to [].
This method runs Array.from(document.querySelectorAll(selector))
within the context and passes it as the
first argument to pageFunction
.
If pageFunction
returns a Promise, then $$eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
Promise which resolves to the return value of pageFunction
This method runs Array.from(document.querySelectorAll(selector))
within the context and passes it as the
first argument to pageFunction
.
If pageFunction
returns a Promise, then $$eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
First argument to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs Array.from(document.querySelectorAll(selector))
within the context and passes it as the
first argument to pageFunction
.
If pageFunction
returns a Promise, then $$eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
First argument to pass to pageFunction
Second argument to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs Array.from(document.querySelectorAll(selector))
within the context and passes it as the
first argument to pageFunction
.
If pageFunction
returns a Promise, then $$eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
First argument to pass to pageFunction
Second argument to pass to pageFunction
Third argument to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs Array.from(document.querySelectorAll(selector))
within the context and passes it as the
first argument to pageFunction
.
If pageFunction
returns a Promise, then $$eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
Arguments to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs document.querySelector
within the context and passes it as the first argument to pageFunction
.
If there's no element matching selector
, the method throws an error.
If pageFunction
returns a Promise, then $eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
Promise which resolves to the return value of pageFunction
This method runs document.querySelector
within the context and passes it as the first argument to pageFunction
.
If there's no element matching selector
, the method throws an error.
If pageFunction
returns a Promise, then $eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
First argument to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs document.querySelector
within the context and passes it as the first argument to pageFunction
.
If there's no element matching selector
, the method throws an error.
If pageFunction
returns a Promise, then $eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
First argument to pass to pageFunction
Second argument to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs document.querySelector
within the context and passes it as the first argument to pageFunction
.
If there's no element matching selector
, the method throws an error.
If pageFunction
returns a Promise, then $eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
First argument to pass to pageFunction
Second argument to pass to pageFunction
Third argument to pass to pageFunction
Promise which resolves to the return value of pageFunction
This method runs document.querySelector
within the context and passes it as the first argument to pageFunction
.
If there's no element matching selector
, the method throws an error.
If pageFunction
returns a Promise, then $eval
would wait for the promise to resolve and return its value.
A selector to query for
Function to be evaluated in browser context
Arguments to pass to pageFunction
Promise which resolves to the return value of pageFunction
The method evaluates the XPath expression.
XPath expression to evaluate.
Adds a <script>
tag into the page with the desired url or content.
Adds a <link rel="stylesheet">
tag into the page with the desired url or a <style type="text/css">
tag with the content.
This method fetches an element with selector, scrolls it into view if needed, and
then uses page.mouse
to click in the center of the element. If there's no element
matching selector, the method throws an error.
A selector to search for element to click. If there are multiple elements satisfying the selector, the first will be clicked.
Specifies the click options.
Gets the full HTML contents of the page, including the doctype.
Evaluates a function in the browser context. If the function, passed to the frame.evaluate, returns a Promise, then frame.evaluate would wait for the promise to resolve and return its value. If the function passed into frame.evaluate returns a non-Serializable value, then frame.evaluate resolves to undefined.
Arguments to pass to fn
The only difference between evaluate
and evaluateHandle
is that evaluateHandle
returns in-page object (JSHandle
).
If the function, passed to the evaluateHandle
, returns a Promise
, then evaluateHandle
would wait for the
promise to resolve and return its value.
The TypeScript definitions assume that evaluateHandle
returns a JSHandle
, but if you know it's going to return an
ElementHandle
, pass it as the generic argument:
a function that is run within the page
arguments to be passed to the pageFunction
This method fetches an element with selector and focuses it.
Navigates to a URL.
URL to navigate page to. The url should include scheme, e.g. https://
The navigation parameters.
This method fetches an element with selector
, scrolls it into view if needed,
and then uses page.mouse to hover over the center of the element. If there's no
element matching selector
, the method throws an error.
A selector to search for element to hover. If there are multiple elements satisfying the selector, the first will be hovered.
Triggers a change
and input
event once all the provided options have been selected.
If there's no <select>
element matching selector, the method throws an error.
A selector to query page for.
Values of options to select. If the <select>
has the multiple
attribute,
all values are considered, otherwise only the first one is taken into account.
Sets the page content.
HTML markup to assign to the page.
The navigation parameters.
This method fetches an element with selector
, scrolls it into view if needed,
and then uses page.touchscreen to tap in the center of the element.
A selector
to search for element to tap. If there are multiple elements
satisfying the selector, the first will be tapped.
Returns page's title.
Sends a keydown
, keypress/input
, and keyup
event for each character in the text.
A selector of an element to type into. If there are multiple elements satisfying the selector, the first will be used.
Returns frame's url.
Allows waiting for various conditions.
Wait for the page navigation occur.
The navigation parameters.
Causes your script to wait for the given number of milliseconds.
the number of milliseconds to wait.
Generated using TypeDoc
The method queries frame for the selector. If there's no such element within the frame, the method will resolve to null.