Get the shadow root attached to this element if present (Chromium, Firefox, Safari). Returns: The ShadowRoot object. Raises: NoSuchShadowRoot: If no shadow root was attached to element. Example: try: shadow_root = element
(self)
| 280 | |
| 281 | @property |
| 282 | def shadow_root(self) -> ShadowRoot: |
| 283 | """Get the shadow root attached to this element if present (Chromium, Firefox, Safari). |
| 284 | |
| 285 | Returns: |
| 286 | The ShadowRoot object. |
| 287 | |
| 288 | Raises: |
| 289 | NoSuchShadowRoot: If no shadow root was attached to element. |
| 290 | |
| 291 | Example: |
| 292 | try: |
| 293 | shadow_root = element.shadow_root |
| 294 | except NoSuchShadowRoot: |
| 295 | print("No shadow root attached to element") |
| 296 | """ |
| 297 | return self._execute(Command.GET_SHADOW_ROOT)["value"] |
| 298 | |
| 299 | # RenderedWebElement Items |
| 300 | def is_displayed(self) -> bool: |