class Playwright::Page

def evaluate_handle(expression, arg: nil)

```
result_handle.dispose()
print(result_handle.json_value())
result_handle = page.evaluate_handle("body => body.innerHTML", a_handle)
a_handle = page.evaluate_handle("document.body")
```python sync

`JSHandle` instances can be passed as an argument to the [`method: Page.evaluateHandle`]:

```
a_handle = page.evaluate_handle("document") # handle for the "document"
```python sync

A string can also be passed in instead of a function:

```
a_window_handle # handle for the window object.
a_window_handle = page.evaluate_handle("Promise.resolve(window)")
```python sync

**Usage**

promise to resolve and return its value.
If the function passed to the [`method: Page.evaluateHandle`] returns a [Promise], then [`method: Page.evaluateHandle`] would wait for the

The only difference between [`method: Page.evaluate`] and [`method: Page.evaluateHandle`] is that [`method: Page.evaluateHandle`] returns `JSHandle`.

Returns the value of the `expression` invocation as a `JSHandle`.
def evaluate_handle(expression, arg: nil)
  wrap_impl(@impl.evaluate_handle(unwrap_impl(expression), arg: unwrap_impl(arg)))
end