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

Class CDPObject

seleniumbase/undetected/cdp.py:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class CDPObject(dict):
10 def __init__(self, *a, **k):
11 super().__init__(*a, **k)
12 self.__dict__ = self
13 for k in self.__dict__:
14 if isinstance(self.__dict__[k], dict):
15 self.__dict__[k] = CDPObject(self.__dict__[k])
16 elif isinstance(self.__dict__[k], list):
17 for i in range(len(self.__dict__[k])):
18 if isinstance(self.__dict__[k][i], dict):
19 self.__dict__[k][i] = CDPObject(self)
20
21 def __repr__(self):
22 tpl = "%s(\n\t{{}}\n\t)" % self.__class__.__name__
23 return tpl.format(
24 "\n ".join("%s = %s" % (k, v) for k, v in self.items())
25 )
26
27
28class PageElement(CDPObject):

Callers 2

__init__Method · 0.85
CDPClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…