Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
playwright.async_api._generated.JSHandle Class Reference
Inheritance diagram for playwright.async_api._generated.JSHandle:
Inheritance graph
[legend]
Collaboration diagram for playwright.async_api._generated.JSHandle:
Collaboration graph
[legend]

Public Member Functions

typing.Any evaluate (self, str expression, typing.Optional[typing.Any] arg=None)
 
"JSHandle" evaluate_handle (self, str expression, typing.Optional[typing.Any] arg=None)
 
"JSHandle" get_property (self, str property_name)
 
typing.Dict[str, "JSHandle"] get_properties (self)
 
typing.Optional["ElementHandle"] as_element (self)
 
None dispose (self)
 
typing.Any json_value (self)
 
- Public Member Functions inherited from playwright._impl._async_base.AsyncBase
None __init__ (self, Any impl_obj)
 
str __str__ (self)
 
None on (self, Any event, Any f)
 
None once (self, Any event, Any f)
 
None remove_listener (self, Any event, Any f)
 
- Public Member Functions inherited from playwright._impl._impl_to_api_mapping.ImplWrapper
str __repr__ (self)
 

Additional Inherited Members

- Protected Member Functions inherited from playwright._impl._async_base.AsyncBase
Callable[..., None] _wrap_handler (self, Union[Callable[..., Any], Any] handler)
 
- Protected Attributes inherited from playwright._impl._async_base.AsyncBase
 _loop
 
- Protected Attributes inherited from playwright._impl._impl_to_api_mapping.ImplWrapper
 _impl_obj
 

Member Function Documentation

◆ as_element()

typing.Optional["ElementHandle"] playwright.async_api._generated.JSHandle.as_element (   self)
JSHandle.as_element

Returns either `null` or the object handle itself, if the object handle is an instance of `ElementHandle`.

Returns
-------
Union[ElementHandle, None]

◆ dispose()

None playwright.async_api._generated.JSHandle.dispose (   self)
JSHandle.dispose

The `jsHandle.dispose` method stops referencing the element handle.

◆ evaluate()

typing.Any playwright.async_api._generated.JSHandle.evaluate (   self,
str  expression,
typing.Optional[typing.Any]   arg = None 
)
JSHandle.evaluate

Returns the return value of `expression`.

This method passes this handle as the first argument to `expression`.

If `expression` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return its
value.

**Usage**

```py
tweet_handle = await page.query_selector(\".tweet .retweets\")
assert await tweet_handle.evaluate(\"node => node.innerText\") == \"10 retweets\"
```

Parameters
----------
expression : str
    JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the
    function is automatically invoked.
arg : Union[Any, None]
    Optional argument to pass to `expression`.

Returns
-------
Any

◆ evaluate_handle()

"JSHandle" playwright.async_api._generated.JSHandle.evaluate_handle (   self,
str  expression,
typing.Optional[typing.Any]   arg = None 
)
JSHandle.evaluate_handle

Returns the return value of `expression` as a `JSHandle`.

This method passes this handle as the first argument to `expression`.

The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle`
returns `JSHandle`.

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

See `page.evaluate_handle()` for more details.

Parameters
----------
expression : str
    JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the
    function is automatically invoked.
arg : Union[Any, None]
    Optional argument to pass to `expression`.

Returns
-------
JSHandle

◆ get_properties()

typing.Dict[str, "JSHandle"] playwright.async_api._generated.JSHandle.get_properties (   self)
JSHandle.get_properties

The method returns a map with **own property names** as keys and JSHandle instances for the property values.

**Usage**

```py
handle = await page.evaluate_handle(\"({ window, document })\")
properties = await handle.get_properties()
window_handle = properties.get(\"window\")
document_handle = properties.get(\"document\")
await handle.dispose()
```

Returns
-------
Dict[str, JSHandle]

◆ get_property()

"JSHandle" playwright.async_api._generated.JSHandle.get_property (   self,
str  property_name 
)
JSHandle.get_property

Fetches a single property from the referenced object.

Parameters
----------
property_name : str
    property to get

Returns
-------
JSHandle

◆ json_value()

typing.Any playwright.async_api._generated.JSHandle.json_value (   self)
JSHandle.json_value

Returns a JSON representation of the object. If the object has a `toJSON` function, it **will not be called**.

**NOTE** The method will return an empty JSON object if the referenced object is not stringifiable. It will throw
an error if the object has circular references.

Returns
-------
Any

The documentation for this class was generated from the following file: