Returns a ElementHandle
Stops referencing the element handle.
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
Gets the execution context.
Returns a map with property names as keys and JSHandle instances for the property values.
Fetches a single property from the objectHandle.
The property to get.
Returns a JSON representation of the object. The JSON is generated by running JSON.stringify on the object in page and consequent JSON.parse in puppeteer.
Generated using TypeDoc
JSHandle represents an in-page JavaScript object.