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

Function create

seleniumbase/undetected/cdp_driver/element.py:23–43  ·  view source on GitHub ↗

Factory for Elements. This is used with Tab.query_selector(_all). Since we already have the tree, we don't need to fetch it for every single element. :param node: cdp dom node representation :type node: cdp.dom.Node :param tab: the target object to which this elem

(
    node: cdp.dom.Node,
    tab: Tab, tree:
    typing.Optional[cdp.dom.Node] = None
)

Source from the content-addressed store, hash-verified

21
22
23def create(
24 node: cdp.dom.Node,
25 tab: Tab, tree:
26 typing.Optional[cdp.dom.Node] = None
27):
28 """
29 Factory for Elements.
30 This is used with Tab.query_selector(_all).
31 Since we already have the tree,
32 we don't need to fetch it for every single element.
33 :param node: cdp dom node representation
34 :type node: cdp.dom.Node
35 :param tab: the target object to which this element belongs
36 :type tab: Tab
37 :param tree: [Optional] the full node tree to which <node> belongs,
38 enhances performance. When not provided, you need to
39 call `await elem.update()` before using .children / .parent
40 :type tree:
41 """
42 elem = Element(node, tab, tree)
43 return elem
44
45
46class Element:

Callers 3

updateMethod · 0.85
parentMethod · 0.85
childrenMethod · 0.85

Calls 1

ElementClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…