MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / parent

Method parent

seleniumbase/undetected/cdp_driver/element.py:309–321  ·  view source on GitHub ↗

Get the parent element (node) of current element (node).

(self)

Source from the content-addressed store, hash-verified

307
308 @property
309 def parent(self) -> typing.Union[Element, None]:
310 """Get the parent element (node) of current element (node)."""
311 if not self.tree:
312 raise RuntimeError(
313 "Could not get parent since the element has no tree set."
314 )
315 parent_node = util.filter_recurse(
316 self.tree, lambda n: n.node_id == self.parent_id
317 )
318 if not parent_node:
319 return None
320 parent_element = create(parent_node, tab=self._tab, tree=self.tree)
321 return parent_element
322
323 @property
324 def children(self) -> typing.Union[typing.List[Element], str]:

Callers

nothing calls this directly

Calls 1

createFunction · 0.85

Tested by

no test coverage detected