parsek-cdp 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. parsek_cdp/__init__.py +55 -0
  2. parsek_cdp/_logging.py +49 -0
  3. parsek_cdp/cdp/__init__.py +247 -0
  4. parsek_cdp/cdp/accessibility/__init__.py +15 -0
  5. parsek_cdp/cdp/accessibility/events.py +35 -0
  6. parsek_cdp/cdp/accessibility/functions.py +202 -0
  7. parsek_cdp/cdp/accessibility/types.py +235 -0
  8. parsek_cdp/cdp/animation/__init__.py +15 -0
  9. parsek_cdp/cdp/animation/events.py +52 -0
  10. parsek_cdp/cdp/animation/functions.py +140 -0
  11. parsek_cdp/cdp/animation/types.py +113 -0
  12. parsek_cdp/cdp/audits/__init__.py +15 -0
  13. parsek_cdp/cdp/audits/events.py +21 -0
  14. parsek_cdp/cdp/audits/functions.py +95 -0
  15. parsek_cdp/cdp/audits/types.py +1051 -0
  16. parsek_cdp/cdp/autofill/__init__.py +15 -0
  17. parsek_cdp/cdp/autofill/events.py +27 -0
  18. parsek_cdp/cdp/autofill/functions.py +64 -0
  19. parsek_cdp/cdp/autofill/types.py +108 -0
  20. parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
  21. parsek_cdp/cdp/backgroundservice/events.py +40 -0
  22. parsek_cdp/cdp/backgroundservice/functions.py +59 -0
  23. parsek_cdp/cdp/backgroundservice/types.py +63 -0
  24. parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
  25. parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
  26. parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
  27. parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
  28. parsek_cdp/cdp/browser/__init__.py +15 -0
  29. parsek_cdp/cdp/browser/events.py +46 -0
  30. parsek_cdp/cdp/browser/functions.py +350 -0
  31. parsek_cdp/cdp/browser/types.py +158 -0
  32. parsek_cdp/cdp/cachestorage/__init__.py +15 -0
  33. parsek_cdp/cdp/cachestorage/events.py +13 -0
  34. parsek_cdp/cdp/cachestorage/functions.py +126 -0
  35. parsek_cdp/cdp/cachestorage/types.py +89 -0
  36. parsek_cdp/cdp/cast/__init__.py +15 -0
  37. parsek_cdp/cdp/cast/events.py +38 -0
  38. parsek_cdp/cdp/cast/functions.py +77 -0
  39. parsek_cdp/cdp/cast/types.py +23 -0
  40. parsek_cdp/cdp/console/__init__.py +15 -0
  41. parsek_cdp/cdp/console/events.py +22 -0
  42. parsek_cdp/cdp/console/functions.py +36 -0
  43. parsek_cdp/cdp/console/types.py +30 -0
  44. parsek_cdp/cdp/css/__init__.py +15 -0
  45. parsek_cdp/cdp/css/events.py +79 -0
  46. parsek_cdp/cdp/css/functions.py +788 -0
  47. parsek_cdp/cdp/css/types.py +742 -0
  48. parsek_cdp/cdp/debugger/__init__.py +15 -0
  49. parsek_cdp/cdp/debugger/events.py +164 -0
  50. parsek_cdp/cdp/debugger/functions.py +663 -0
  51. parsek_cdp/cdp/debugger/types.py +171 -0
  52. parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
  53. parsek_cdp/cdp/deviceaccess/events.py +30 -0
  54. parsek_cdp/cdp/deviceaccess/functions.py +54 -0
  55. parsek_cdp/cdp/deviceaccess/types.py +28 -0
  56. parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
  57. parsek_cdp/cdp/deviceorientation/events.py +13 -0
  58. parsek_cdp/cdp/deviceorientation/functions.py +35 -0
  59. parsek_cdp/cdp/deviceorientation/types.py +10 -0
  60. parsek_cdp/cdp/dom/__init__.py +15 -0
  61. parsek_cdp/cdp/dom/events.py +228 -0
  62. parsek_cdp/cdp/dom/functions.py +1033 -0
  63. parsek_cdp/cdp/dom/types.py +293 -0
  64. parsek_cdp/cdp/domdebugger/__init__.py +15 -0
  65. parsek_cdp/cdp/domdebugger/events.py +13 -0
  66. parsek_cdp/cdp/domdebugger/functions.py +155 -0
  67. parsek_cdp/cdp/domdebugger/types.py +57 -0
  68. parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
  69. parsek_cdp/cdp/domsnapshot/events.py +13 -0
  70. parsek_cdp/cdp/domsnapshot/functions.py +111 -0
  71. parsek_cdp/cdp/domsnapshot/types.py +312 -0
  72. parsek_cdp/cdp/domstorage/__init__.py +15 -0
  73. parsek_cdp/cdp/domstorage/events.py +60 -0
  74. parsek_cdp/cdp/domstorage/functions.py +79 -0
  75. parsek_cdp/cdp/domstorage/types.py +30 -0
  76. parsek_cdp/cdp/emulation/__init__.py +15 -0
  77. parsek_cdp/cdp/emulation/events.py +17 -0
  78. parsek_cdp/cdp/emulation/functions.py +688 -0
  79. parsek_cdp/cdp/emulation/types.py +305 -0
  80. parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
  81. parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
  82. parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
  83. parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
  84. parsek_cdp/cdp/extensions/__init__.py +15 -0
  85. parsek_cdp/cdp/extensions/events.py +13 -0
  86. parsek_cdp/cdp/extensions/functions.py +118 -0
  87. parsek_cdp/cdp/extensions/types.py +19 -0
  88. parsek_cdp/cdp/fedcm/__init__.py +15 -0
  89. parsek_cdp/cdp/fedcm/events.py +45 -0
  90. parsek_cdp/cdp/fedcm/functions.py +93 -0
  91. parsek_cdp/cdp/fedcm/types.py +72 -0
  92. parsek_cdp/cdp/fetch/__init__.py +15 -0
  93. parsek_cdp/cdp/fetch/events.py +82 -0
  94. parsek_cdp/cdp/fetch/functions.py +215 -0
  95. parsek_cdp/cdp/fetch/types.py +81 -0
  96. parsek_cdp/cdp/filesystem/__init__.py +15 -0
  97. parsek_cdp/cdp/filesystem/events.py +13 -0
  98. parsek_cdp/cdp/filesystem/functions.py +36 -0
  99. parsek_cdp/cdp/filesystem/types.py +54 -0
  100. parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
  101. parsek_cdp/cdp/headlessexperimental/events.py +13 -0
  102. parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
  103. parsek_cdp/cdp/headlessexperimental/types.py +24 -0
  104. parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
  105. parsek_cdp/cdp/heapprofiler/events.py +65 -0
  106. parsek_cdp/cdp/heapprofiler/functions.py +193 -0
  107. parsek_cdp/cdp/heapprofiler/types.py +57 -0
  108. parsek_cdp/cdp/indexeddb/__init__.py +15 -0
  109. parsek_cdp/cdp/indexeddb/events.py +13 -0
  110. parsek_cdp/cdp/indexeddb/functions.py +232 -0
  111. parsek_cdp/cdp/indexeddb/types.py +120 -0
  112. parsek_cdp/cdp/input/__init__.py +15 -0
  113. parsek_cdp/cdp/input/events.py +25 -0
  114. parsek_cdp/cdp/input/functions.py +361 -0
  115. parsek_cdp/cdp/input/types.py +87 -0
  116. parsek_cdp/cdp/inspector/__init__.py +15 -0
  117. parsek_cdp/cdp/inspector/events.py +41 -0
  118. parsek_cdp/cdp/inspector/functions.py +27 -0
  119. parsek_cdp/cdp/inspector/types.py +10 -0
  120. parsek_cdp/cdp/io/__init__.py +15 -0
  121. parsek_cdp/cdp/io/events.py +13 -0
  122. parsek_cdp/cdp/io/functions.py +77 -0
  123. parsek_cdp/cdp/io/types.py +13 -0
  124. parsek_cdp/cdp/layertree/__init__.py +15 -0
  125. parsek_cdp/cdp/layertree/events.py +36 -0
  126. parsek_cdp/cdp/layertree/functions.py +178 -0
  127. parsek_cdp/cdp/layertree/types.py +104 -0
  128. parsek_cdp/cdp/log/__init__.py +15 -0
  129. parsek_cdp/cdp/log/events.py +22 -0
  130. parsek_cdp/cdp/log/functions.py +54 -0
  131. parsek_cdp/cdp/log/types.py +57 -0
  132. parsek_cdp/cdp/media/__init__.py +15 -0
  133. parsek_cdp/cdp/media/events.py +87 -0
  134. parsek_cdp/cdp/media/functions.py +27 -0
  135. parsek_cdp/cdp/media/types.py +101 -0
  136. parsek_cdp/cdp/memory/__init__.py +15 -0
  137. parsek_cdp/cdp/memory/events.py +13 -0
  138. parsek_cdp/cdp/memory/functions.py +164 -0
  139. parsek_cdp/cdp/memory/types.py +71 -0
  140. parsek_cdp/cdp/mixins/__init__.py +21 -0
  141. parsek_cdp/cdp/mixins/datatype.py +123 -0
  142. parsek_cdp/cdp/mixins/event.py +78 -0
  143. parsek_cdp/cdp/mixins/namespace.py +31 -0
  144. parsek_cdp/cdp/network/__init__.py +15 -0
  145. parsek_cdp/cdp/network/events.py +726 -0
  146. parsek_cdp/cdp/network/functions.py +734 -0
  147. parsek_cdp/cdp/network/types.py +1247 -0
  148. parsek_cdp/cdp/overlay/__init__.py +15 -0
  149. parsek_cdp/cdp/overlay/events.py +54 -0
  150. parsek_cdp/cdp/overlay/functions.py +407 -0
  151. parsek_cdp/cdp/overlay/types.py +328 -0
  152. parsek_cdp/cdp/page/__init__.py +15 -0
  153. parsek_cdp/cdp/page/events.py +416 -0
  154. parsek_cdp/cdp/page/functions.py +1081 -0
  155. parsek_cdp/cdp/page/types.py +1088 -0
  156. parsek_cdp/cdp/performance/__init__.py +15 -0
  157. parsek_cdp/cdp/performance/events.py +24 -0
  158. parsek_cdp/cdp/performance/functions.py +63 -0
  159. parsek_cdp/cdp/performance/types.py +22 -0
  160. parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
  161. parsek_cdp/cdp/performancetimeline/events.py +22 -0
  162. parsek_cdp/cdp/performancetimeline/functions.py +30 -0
  163. parsek_cdp/cdp/performancetimeline/types.py +85 -0
  164. parsek_cdp/cdp/preload/__init__.py +15 -0
  165. parsek_cdp/cdp/preload/events.py +116 -0
  166. parsek_cdp/cdp/preload/functions.py +25 -0
  167. parsek_cdp/cdp/preload/types.py +267 -0
  168. parsek_cdp/cdp/profiler/__init__.py +15 -0
  169. parsek_cdp/cdp/profiler/events.py +64 -0
  170. parsek_cdp/cdp/profiler/functions.py +134 -0
  171. parsek_cdp/cdp/profiler/types.py +105 -0
  172. parsek_cdp/cdp/pwa/__init__.py +15 -0
  173. parsek_cdp/cdp/pwa/events.py +13 -0
  174. parsek_cdp/cdp/pwa/functions.py +196 -0
  175. parsek_cdp/cdp/pwa/types.py +45 -0
  176. parsek_cdp/cdp/runtime/__init__.py +15 -0
  177. parsek_cdp/cdp/runtime/events.py +123 -0
  178. parsek_cdp/cdp/runtime/functions.py +552 -0
  179. parsek_cdp/cdp/runtime/types.py +319 -0
  180. parsek_cdp/cdp/schema/__init__.py +15 -0
  181. parsek_cdp/cdp/schema/events.py +13 -0
  182. parsek_cdp/cdp/schema/functions.py +32 -0
  183. parsek_cdp/cdp/schema/types.py +22 -0
  184. parsek_cdp/cdp/security/__init__.py +15 -0
  185. parsek_cdp/cdp/security/events.py +64 -0
  186. parsek_cdp/cdp/security/functions.py +66 -0
  187. parsek_cdp/cdp/security/types.py +168 -0
  188. parsek_cdp/cdp/serviceworker/__init__.py +15 -0
  189. parsek_cdp/cdp/serviceworker/events.py +43 -0
  190. parsek_cdp/cdp/serviceworker/functions.py +115 -0
  191. parsek_cdp/cdp/serviceworker/types.py +95 -0
  192. parsek_cdp/cdp/storage/__init__.py +15 -0
  193. parsek_cdp/cdp/storage/events.py +288 -0
  194. parsek_cdp/cdp/storage/functions.py +571 -0
  195. parsek_cdp/cdp/storage/types.py +656 -0
  196. parsek_cdp/cdp/systeminfo/__init__.py +15 -0
  197. parsek_cdp/cdp/systeminfo/events.py +13 -0
  198. parsek_cdp/cdp/systeminfo/functions.py +75 -0
  199. parsek_cdp/cdp/systeminfo/types.py +132 -0
  200. parsek_cdp/cdp/target/__init__.py +15 -0
  201. parsek_cdp/cdp/target/events.py +109 -0
  202. parsek_cdp/cdp/target/functions.py +424 -0
  203. parsek_cdp/cdp/target/types.py +83 -0
  204. parsek_cdp/cdp/tethering/__init__.py +15 -0
  205. parsek_cdp/cdp/tethering/events.py +22 -0
  206. parsek_cdp/cdp/tethering/functions.py +35 -0
  207. parsek_cdp/cdp/tethering/types.py +10 -0
  208. parsek_cdp/cdp/tracing/__init__.py +15 -0
  209. parsek_cdp/cdp/tracing/events.py +61 -0
  210. parsek_cdp/cdp/tracing/functions.py +119 -0
  211. parsek_cdp/cdp/tracing/types.py +81 -0
  212. parsek_cdp/cdp/webaudio/__init__.py +15 -0
  213. parsek_cdp/cdp/webaudio/events.py +184 -0
  214. parsek_cdp/cdp/webaudio/functions.py +51 -0
  215. parsek_cdp/cdp/webaudio/types.py +155 -0
  216. parsek_cdp/cdp/webauthn/__init__.py +15 -0
  217. parsek_cdp/cdp/webauthn/events.py +69 -0
  218. parsek_cdp/cdp/webauthn/functions.py +214 -0
  219. parsek_cdp/cdp/webauthn/types.py +96 -0
  220. parsek_cdp/core/__init__.py +18 -0
  221. parsek_cdp/core/browser.py +240 -0
  222. parsek_cdp/core/browser_context.py +58 -0
  223. parsek_cdp/core/element.py +405 -0
  224. parsek_cdp/core/feature.py +376 -0
  225. parsek_cdp/core/frame.py +351 -0
  226. parsek_cdp/core/pagable.py +175 -0
  227. parsek_cdp/core/page.py +163 -0
  228. parsek_cdp/core/target.py +490 -0
  229. parsek_cdp/features/__init__.py +14 -0
  230. parsek_cdp/features/request_listener/__init__.py +256 -0
  231. parsek_cdp/features/request_listener/events.py +48 -0
  232. parsek_cdp/features/request_listener/types.py +235 -0
  233. parsek_cdp/generate.py +642 -0
  234. parsek_cdp/parsek/__init__.py +18 -0
  235. parsek_cdp/parsek/events.py +38 -0
  236. parsek_cdp/parsek/types.py +36 -0
  237. parsek_cdp/py.typed +0 -0
  238. parsek_cdp-0.1.0.dist-info/METADATA +277 -0
  239. parsek_cdp-0.1.0.dist-info/RECORD +242 -0
  240. parsek_cdp-0.1.0.dist-info/WHEEL +5 -0
  241. parsek_cdp-0.1.0.dist-info/licenses/LICENSE +201 -0
  242. parsek_cdp-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1033 @@
1
+ """Commands for the DOM domain (generated)."""
2
+ from __future__ import annotations
3
+
4
+ from dataclasses import dataclass
5
+ from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
6
+
7
+ from ..mixins.datatype import DataType, FieldMeta, encode
8
+
9
+ if TYPE_CHECKING:
10
+ from .types import (
11
+ BackendNodeId,
12
+ BoxModel,
13
+ CSSComputedStyleProperty,
14
+ DetachedElementInfo,
15
+ LogicalAxes,
16
+ Node,
17
+ NodeId,
18
+ PhysicalAxes,
19
+ Quad,
20
+ Rect,
21
+ )
22
+ from ..page.types import FrameId as Page_FrameId
23
+ from ..runtime.types import ExecutionContextId as Runtime_ExecutionContextId
24
+ from ..runtime.types import RemoteObject as Runtime_RemoteObject
25
+ from ..runtime.types import RemoteObjectId as Runtime_RemoteObjectId
26
+ from ..runtime.types import StackTrace as Runtime_StackTrace
27
+
28
+ @dataclass
29
+ class CollectClassNamesFromSubtreeReturn(DataType):
30
+ """Return value of :meth:`DOM.collect_class_names_from_subtree`."""
31
+ class_names: List[str]
32
+ __FIELDS__: ClassVar[tuple] = (
33
+ FieldMeta('class_names', 'classNames', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
34
+ )
35
+
36
+
37
+ @dataclass
38
+ class CopyToReturn(DataType):
39
+ """Return value of :meth:`DOM.copy_to`."""
40
+ node_id: NodeId
41
+ __FIELDS__: ClassVar[tuple] = (
42
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
43
+ )
44
+
45
+
46
+ @dataclass
47
+ class DescribeNodeReturn(DataType):
48
+ """Return value of :meth:`DOM.describe_node`."""
49
+ node: Node
50
+ __FIELDS__: ClassVar[tuple] = (
51
+ FieldMeta('node', 'node', False, 'object', ref='DOM.Node'),
52
+ )
53
+
54
+
55
+ @dataclass
56
+ class GetAttributesReturn(DataType):
57
+ """Return value of :meth:`DOM.get_attributes`."""
58
+ attributes: List[str]
59
+ __FIELDS__: ClassVar[tuple] = (
60
+ FieldMeta('attributes', 'attributes', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
61
+ )
62
+
63
+
64
+ @dataclass
65
+ class GetBoxModelReturn(DataType):
66
+ """Return value of :meth:`DOM.get_box_model`."""
67
+ model: BoxModel
68
+ __FIELDS__: ClassVar[tuple] = (
69
+ FieldMeta('model', 'model', False, 'object', ref='DOM.BoxModel'),
70
+ )
71
+
72
+
73
+ @dataclass
74
+ class GetContentQuadsReturn(DataType):
75
+ """Return value of :meth:`DOM.get_content_quads`."""
76
+ quads: List[Quad]
77
+ __FIELDS__: ClassVar[tuple] = (
78
+ FieldMeta('quads', 'quads', False, 'array', inner=FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive'))),
79
+ )
80
+
81
+
82
+ @dataclass
83
+ class GetDocumentReturn(DataType):
84
+ """Return value of :meth:`DOM.get_document`."""
85
+ root: Node
86
+ __FIELDS__: ClassVar[tuple] = (
87
+ FieldMeta('root', 'root', False, 'object', ref='DOM.Node'),
88
+ )
89
+
90
+
91
+ @dataclass
92
+ class GetFlattenedDocumentReturn(DataType):
93
+ """Return value of :meth:`DOM.get_flattened_document`."""
94
+ nodes: List[Node]
95
+ __FIELDS__: ClassVar[tuple] = (
96
+ FieldMeta('nodes', 'nodes', False, 'array', inner=FieldMeta('', '', False, 'object', ref='DOM.Node')),
97
+ )
98
+
99
+
100
+ @dataclass
101
+ class GetNodesForSubtreeByStyleReturn(DataType):
102
+ """Return value of :meth:`DOM.get_nodes_for_subtree_by_style`."""
103
+ node_ids: List[NodeId]
104
+ __FIELDS__: ClassVar[tuple] = (
105
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
106
+ )
107
+
108
+
109
+ @dataclass
110
+ class GetNodeForLocationReturn(DataType):
111
+ """Return value of :meth:`DOM.get_node_for_location`."""
112
+ backend_node_id: BackendNodeId
113
+ frame_id: Page_FrameId
114
+ node_id: Optional[NodeId] = None
115
+ __FIELDS__: ClassVar[tuple] = (
116
+ FieldMeta('backend_node_id', 'backendNodeId', False, 'primitive'),
117
+ FieldMeta('frame_id', 'frameId', False, 'primitive'),
118
+ FieldMeta('node_id', 'nodeId', True, 'primitive'),
119
+ )
120
+
121
+
122
+ @dataclass
123
+ class GetOuterHTMLReturn(DataType):
124
+ """Return value of :meth:`DOM.get_outer_html`."""
125
+ outer_html: str
126
+ __FIELDS__: ClassVar[tuple] = (
127
+ FieldMeta('outer_html', 'outerHTML', False, 'primitive'),
128
+ )
129
+
130
+
131
+ @dataclass
132
+ class GetRelayoutBoundaryReturn(DataType):
133
+ """Return value of :meth:`DOM.get_relayout_boundary`."""
134
+ node_id: NodeId
135
+ __FIELDS__: ClassVar[tuple] = (
136
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
137
+ )
138
+
139
+
140
+ @dataclass
141
+ class GetSearchResultsReturn(DataType):
142
+ """Return value of :meth:`DOM.get_search_results`."""
143
+ node_ids: List[NodeId]
144
+ __FIELDS__: ClassVar[tuple] = (
145
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
146
+ )
147
+
148
+
149
+ @dataclass
150
+ class MoveToReturn(DataType):
151
+ """Return value of :meth:`DOM.move_to`."""
152
+ node_id: NodeId
153
+ __FIELDS__: ClassVar[tuple] = (
154
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
155
+ )
156
+
157
+
158
+ @dataclass
159
+ class PerformSearchReturn(DataType):
160
+ """Return value of :meth:`DOM.perform_search`."""
161
+ search_id: str
162
+ result_count: int
163
+ __FIELDS__: ClassVar[tuple] = (
164
+ FieldMeta('search_id', 'searchId', False, 'primitive'),
165
+ FieldMeta('result_count', 'resultCount', False, 'primitive'),
166
+ )
167
+
168
+
169
+ @dataclass
170
+ class PushNodeByPathToFrontendReturn(DataType):
171
+ """Return value of :meth:`DOM.push_node_by_path_to_frontend`."""
172
+ node_id: NodeId
173
+ __FIELDS__: ClassVar[tuple] = (
174
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
175
+ )
176
+
177
+
178
+ @dataclass
179
+ class PushNodesByBackendIdsToFrontendReturn(DataType):
180
+ """Return value of :meth:`DOM.push_nodes_by_backend_ids_to_frontend`."""
181
+ node_ids: List[NodeId]
182
+ __FIELDS__: ClassVar[tuple] = (
183
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
184
+ )
185
+
186
+
187
+ @dataclass
188
+ class QuerySelectorReturn(DataType):
189
+ """Return value of :meth:`DOM.query_selector`."""
190
+ node_id: NodeId
191
+ __FIELDS__: ClassVar[tuple] = (
192
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
193
+ )
194
+
195
+
196
+ @dataclass
197
+ class QuerySelectorAllReturn(DataType):
198
+ """Return value of :meth:`DOM.query_selector_all`."""
199
+ node_ids: List[NodeId]
200
+ __FIELDS__: ClassVar[tuple] = (
201
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
202
+ )
203
+
204
+
205
+ @dataclass
206
+ class GetTopLayerElementsReturn(DataType):
207
+ """Return value of :meth:`DOM.get_top_layer_elements`."""
208
+ node_ids: List[NodeId]
209
+ __FIELDS__: ClassVar[tuple] = (
210
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
211
+ )
212
+
213
+
214
+ @dataclass
215
+ class GetElementByRelationReturn(DataType):
216
+ """Return value of :meth:`DOM.get_element_by_relation`."""
217
+ node_id: NodeId
218
+ __FIELDS__: ClassVar[tuple] = (
219
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
220
+ )
221
+
222
+
223
+ @dataclass
224
+ class RequestNodeReturn(DataType):
225
+ """Return value of :meth:`DOM.request_node`."""
226
+ node_id: NodeId
227
+ __FIELDS__: ClassVar[tuple] = (
228
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
229
+ )
230
+
231
+
232
+ @dataclass
233
+ class ResolveNodeReturn(DataType):
234
+ """Return value of :meth:`DOM.resolve_node`."""
235
+ object: Runtime_RemoteObject
236
+ __FIELDS__: ClassVar[tuple] = (
237
+ FieldMeta('object', 'object', False, 'object', ref='Runtime.RemoteObject'),
238
+ )
239
+
240
+
241
+ @dataclass
242
+ class GetNodeStackTracesReturn(DataType):
243
+ """Return value of :meth:`DOM.get_node_stack_traces`."""
244
+ creation: Optional[Runtime_StackTrace] = None
245
+ __FIELDS__: ClassVar[tuple] = (
246
+ FieldMeta('creation', 'creation', True, 'object', ref='Runtime.StackTrace'),
247
+ )
248
+
249
+
250
+ @dataclass
251
+ class GetFileInfoReturn(DataType):
252
+ """Return value of :meth:`DOM.get_file_info`."""
253
+ path: str
254
+ __FIELDS__: ClassVar[tuple] = (
255
+ FieldMeta('path', 'path', False, 'primitive'),
256
+ )
257
+
258
+
259
+ @dataclass
260
+ class GetDetachedDomNodesReturn(DataType):
261
+ """Return value of :meth:`DOM.get_detached_dom_nodes`."""
262
+ detached_nodes: List[DetachedElementInfo]
263
+ __FIELDS__: ClassVar[tuple] = (
264
+ FieldMeta('detached_nodes', 'detachedNodes', False, 'array', inner=FieldMeta('', '', False, 'object', ref='DOM.DetachedElementInfo')),
265
+ )
266
+
267
+
268
+ @dataclass
269
+ class SetNodeNameReturn(DataType):
270
+ """Return value of :meth:`DOM.set_node_name`."""
271
+ node_id: NodeId
272
+ __FIELDS__: ClassVar[tuple] = (
273
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
274
+ )
275
+
276
+
277
+ @dataclass
278
+ class GetFrameOwnerReturn(DataType):
279
+ """Return value of :meth:`DOM.get_frame_owner`."""
280
+ backend_node_id: BackendNodeId
281
+ node_id: Optional[NodeId] = None
282
+ __FIELDS__: ClassVar[tuple] = (
283
+ FieldMeta('backend_node_id', 'backendNodeId', False, 'primitive'),
284
+ FieldMeta('node_id', 'nodeId', True, 'primitive'),
285
+ )
286
+
287
+
288
+ @dataclass
289
+ class GetContainerForNodeReturn(DataType):
290
+ """Return value of :meth:`DOM.get_container_for_node`."""
291
+ node_id: Optional[NodeId] = None
292
+ __FIELDS__: ClassVar[tuple] = (
293
+ FieldMeta('node_id', 'nodeId', True, 'primitive'),
294
+ )
295
+
296
+
297
+ @dataclass
298
+ class GetQueryingDescendantsForContainerReturn(DataType):
299
+ """Return value of :meth:`DOM.get_querying_descendants_for_container`."""
300
+ node_ids: List[NodeId]
301
+ __FIELDS__: ClassVar[tuple] = (
302
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
303
+ )
304
+
305
+
306
+ @dataclass
307
+ class GetAnchorElementReturn(DataType):
308
+ """Return value of :meth:`DOM.get_anchor_element`."""
309
+ node_id: NodeId
310
+ __FIELDS__: ClassVar[tuple] = (
311
+ FieldMeta('node_id', 'nodeId', False, 'primitive'),
312
+ )
313
+
314
+
315
+ @dataclass
316
+ class ForceShowPopoverReturn(DataType):
317
+ """Return value of :meth:`DOM.force_show_popover`."""
318
+ node_ids: List[NodeId]
319
+ __FIELDS__: ClassVar[tuple] = (
320
+ FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
321
+ )
322
+
323
+
324
+ class DOM:
325
+ """Commands of the DOM domain, bound to a target."""
326
+
327
+ def __init__(self, target: Any) -> None:
328
+ self._target = target
329
+
330
+
331
+ async def collect_class_names_from_subtree(self, *, node_id: NodeId) -> CollectClassNamesFromSubtreeReturn:
332
+ """
333
+ Collects class names for the node with given id and all of it's child nodes.
334
+ :param node_id: Id of the node to collect class names.
335
+ """
336
+ _params: Dict[str, Any] = {}
337
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
338
+ _result = await self._target.send('DOM.collectClassNamesFromSubtree', _params)
339
+ return CollectClassNamesFromSubtreeReturn.from_json(_result)
340
+
341
+ async def copy_to(self, *, node_id: NodeId, target_node_id: NodeId, insert_before_node_id: Optional[NodeId] = None) -> CopyToReturn:
342
+ """
343
+ Creates a deep copy of the specified node and places it into the target container before the
344
+ given anchor.
345
+ :param node_id: Id of the node to copy.
346
+ :param target_node_id: Id of the element to drop the copy into.
347
+ :param insert_before_node_id: Drop the copy before this node (if absent, the copy becomes the last child of
348
+ `targetNodeId`).
349
+ """
350
+ _params: Dict[str, Any] = {}
351
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
352
+ _params['targetNodeId'] = encode(FieldMeta('', '', False, 'primitive'), target_node_id)
353
+ if insert_before_node_id is not None:
354
+ _params['insertBeforeNodeId'] = encode(FieldMeta('', '', False, 'primitive'), insert_before_node_id)
355
+ _result = await self._target.send('DOM.copyTo', _params)
356
+ return CopyToReturn.from_json(_result)
357
+
358
+ async def describe_node(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None, depth: Optional[int] = None, pierce: Optional[bool] = None) -> DescribeNodeReturn:
359
+ """
360
+ Describes node given its id, does not require domain to be enabled. Does not start tracking any
361
+ objects, can be used for automation.
362
+ :param node_id: Identifier of the node.
363
+ :param backend_node_id: Identifier of the backend node.
364
+ :param object_id: JavaScript object id of the node wrapper.
365
+ :param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
366
+ entire subtree or provide an integer larger than 0.
367
+ :param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
368
+ (default is false).
369
+ """
370
+ _params: Dict[str, Any] = {}
371
+ if node_id is not None:
372
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
373
+ if backend_node_id is not None:
374
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
375
+ if object_id is not None:
376
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
377
+ if depth is not None:
378
+ _params['depth'] = encode(FieldMeta('', '', False, 'primitive'), depth)
379
+ if pierce is not None:
380
+ _params['pierce'] = encode(FieldMeta('', '', False, 'primitive'), pierce)
381
+ _result = await self._target.send('DOM.describeNode', _params)
382
+ return DescribeNodeReturn.from_json(_result)
383
+
384
+ async def scroll_into_view_if_needed(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None, rect: Optional[Rect] = None) -> None:
385
+ """
386
+ Scrolls the specified rect of the given node into view if not already visible.
387
+ Note: exactly one between nodeId, backendNodeId and objectId should be passed
388
+ to identify the node.
389
+ :param node_id: Identifier of the node.
390
+ :param backend_node_id: Identifier of the backend node.
391
+ :param object_id: JavaScript object id of the node wrapper.
392
+ :param rect: The rect to be scrolled into view, relative to the node's border box, in CSS pixels.
393
+ When omitted, center of the node will be used, similar to Element.scrollIntoView.
394
+ """
395
+ _params: Dict[str, Any] = {}
396
+ if node_id is not None:
397
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
398
+ if backend_node_id is not None:
399
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
400
+ if object_id is not None:
401
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
402
+ if rect is not None:
403
+ _params['rect'] = encode(FieldMeta('', '', False, 'object', ref='DOM.Rect'), rect)
404
+ _result = await self._target.send('DOM.scrollIntoViewIfNeeded', _params)
405
+ return None
406
+
407
+ async def disable(self) -> None:
408
+ """Disables DOM agent for the given page."""
409
+ _params: Dict[str, Any] = {}
410
+ _result = await self._target.send('DOM.disable', _params)
411
+ return None
412
+
413
+ async def discard_search_results(self, *, search_id: str) -> None:
414
+ """
415
+ Discards search results from the session with the given id. `getSearchResults` should no longer
416
+ be called for that search.
417
+ :param search_id: Unique search session identifier.
418
+ """
419
+ _params: Dict[str, Any] = {}
420
+ _params['searchId'] = encode(FieldMeta('', '', False, 'primitive'), search_id)
421
+ _result = await self._target.send('DOM.discardSearchResults', _params)
422
+ return None
423
+
424
+ async def enable(self, *, include_whitespace: Optional[Literal['none', 'all']] = None) -> None:
425
+ """
426
+ Enables DOM agent for the given page.
427
+ :param include_whitespace: Whether to include whitespaces in the children array of returned Nodes.
428
+ """
429
+ _params: Dict[str, Any] = {}
430
+ if include_whitespace is not None:
431
+ _params['includeWhitespace'] = encode(FieldMeta('', '', False, 'primitive'), include_whitespace)
432
+ _result = await self._target.send('DOM.enable', _params)
433
+ return None
434
+
435
+ async def focus(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None) -> None:
436
+ """
437
+ Focuses the given element.
438
+ :param node_id: Identifier of the node.
439
+ :param backend_node_id: Identifier of the backend node.
440
+ :param object_id: JavaScript object id of the node wrapper.
441
+ """
442
+ _params: Dict[str, Any] = {}
443
+ if node_id is not None:
444
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
445
+ if backend_node_id is not None:
446
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
447
+ if object_id is not None:
448
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
449
+ _result = await self._target.send('DOM.focus', _params)
450
+ return None
451
+
452
+ async def get_attributes(self, *, node_id: NodeId) -> GetAttributesReturn:
453
+ """
454
+ Returns attributes for the specified node.
455
+ :param node_id: Id of the node to retrieve attributes for.
456
+ """
457
+ _params: Dict[str, Any] = {}
458
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
459
+ _result = await self._target.send('DOM.getAttributes', _params)
460
+ return GetAttributesReturn.from_json(_result)
461
+
462
+ async def get_box_model(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None) -> GetBoxModelReturn:
463
+ """
464
+ Returns boxes for the given node.
465
+ :param node_id: Identifier of the node.
466
+ :param backend_node_id: Identifier of the backend node.
467
+ :param object_id: JavaScript object id of the node wrapper.
468
+ """
469
+ _params: Dict[str, Any] = {}
470
+ if node_id is not None:
471
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
472
+ if backend_node_id is not None:
473
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
474
+ if object_id is not None:
475
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
476
+ _result = await self._target.send('DOM.getBoxModel', _params)
477
+ return GetBoxModelReturn.from_json(_result)
478
+
479
+ async def get_content_quads(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None) -> GetContentQuadsReturn:
480
+ """
481
+ Returns quads that describe node position on the page. This method
482
+ might return multiple quads for inline nodes.
483
+ :param node_id: Identifier of the node.
484
+ :param backend_node_id: Identifier of the backend node.
485
+ :param object_id: JavaScript object id of the node wrapper.
486
+ """
487
+ _params: Dict[str, Any] = {}
488
+ if node_id is not None:
489
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
490
+ if backend_node_id is not None:
491
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
492
+ if object_id is not None:
493
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
494
+ _result = await self._target.send('DOM.getContentQuads', _params)
495
+ return GetContentQuadsReturn.from_json(_result)
496
+
497
+ async def get_document(self, *, depth: Optional[int] = None, pierce: Optional[bool] = None) -> GetDocumentReturn:
498
+ """
499
+ Returns the root DOM node (and optionally the subtree) to the caller.
500
+ Implicitly enables the DOM domain events for the current target.
501
+ :param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
502
+ entire subtree or provide an integer larger than 0.
503
+ :param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
504
+ (default is false).
505
+ """
506
+ _params: Dict[str, Any] = {}
507
+ if depth is not None:
508
+ _params['depth'] = encode(FieldMeta('', '', False, 'primitive'), depth)
509
+ if pierce is not None:
510
+ _params['pierce'] = encode(FieldMeta('', '', False, 'primitive'), pierce)
511
+ _result = await self._target.send('DOM.getDocument', _params)
512
+ return GetDocumentReturn.from_json(_result)
513
+
514
+ async def get_flattened_document(self, *, depth: Optional[int] = None, pierce: Optional[bool] = None) -> GetFlattenedDocumentReturn:
515
+ """
516
+ Returns the root DOM node (and optionally the subtree) to the caller.
517
+ Deprecated, as it is not designed to work well with the rest of the DOM agent.
518
+ Use DOMSnapshot.captureSnapshot instead.
519
+
520
+ .. deprecated::
521
+ :param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
522
+ entire subtree or provide an integer larger than 0.
523
+ :param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
524
+ (default is false).
525
+ """
526
+ _params: Dict[str, Any] = {}
527
+ if depth is not None:
528
+ _params['depth'] = encode(FieldMeta('', '', False, 'primitive'), depth)
529
+ if pierce is not None:
530
+ _params['pierce'] = encode(FieldMeta('', '', False, 'primitive'), pierce)
531
+ _result = await self._target.send('DOM.getFlattenedDocument', _params)
532
+ return GetFlattenedDocumentReturn.from_json(_result)
533
+
534
+ async def get_nodes_for_subtree_by_style(self, *, node_id: NodeId, computed_styles: List[CSSComputedStyleProperty], pierce: Optional[bool] = None) -> GetNodesForSubtreeByStyleReturn:
535
+ """
536
+ Finds nodes with a given computed style in a subtree.
537
+ :param node_id: Node ID pointing to the root of a subtree.
538
+ :param computed_styles: The style to filter nodes by (includes nodes if any of properties matches).
539
+ :param pierce: Whether or not iframes and shadow roots in the same target should be traversed when returning the
540
+ results (default is false).
541
+ """
542
+ _params: Dict[str, Any] = {}
543
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
544
+ _params['computedStyles'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='DOM.CSSComputedStyleProperty')), computed_styles)
545
+ if pierce is not None:
546
+ _params['pierce'] = encode(FieldMeta('', '', False, 'primitive'), pierce)
547
+ _result = await self._target.send('DOM.getNodesForSubtreeByStyle', _params)
548
+ return GetNodesForSubtreeByStyleReturn.from_json(_result)
549
+
550
+ async def get_node_for_location(self, *, x: int, y: int, include_user_agent_shadow_dom: Optional[bool] = None, ignore_pointer_events_none: Optional[bool] = None) -> GetNodeForLocationReturn:
551
+ """
552
+ Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
553
+ either returned or not.
554
+ :param x: X coordinate.
555
+ :param y: Y coordinate.
556
+ :param include_user_agent_shadow_dom: False to skip to the nearest non-UA shadow root ancestor (default: false).
557
+ :param ignore_pointer_events_none: Whether to ignore pointer-events: none on elements and hit test them.
558
+ """
559
+ _params: Dict[str, Any] = {}
560
+ _params['x'] = encode(FieldMeta('', '', False, 'primitive'), x)
561
+ _params['y'] = encode(FieldMeta('', '', False, 'primitive'), y)
562
+ if include_user_agent_shadow_dom is not None:
563
+ _params['includeUserAgentShadowDOM'] = encode(FieldMeta('', '', False, 'primitive'), include_user_agent_shadow_dom)
564
+ if ignore_pointer_events_none is not None:
565
+ _params['ignorePointerEventsNone'] = encode(FieldMeta('', '', False, 'primitive'), ignore_pointer_events_none)
566
+ _result = await self._target.send('DOM.getNodeForLocation', _params)
567
+ return GetNodeForLocationReturn.from_json(_result)
568
+
569
+ async def get_outer_html(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None, include_shadow_dom: Optional[bool] = None) -> GetOuterHTMLReturn:
570
+ """
571
+ Returns node's HTML markup.
572
+ :param node_id: Identifier of the node.
573
+ :param backend_node_id: Identifier of the backend node.
574
+ :param object_id: JavaScript object id of the node wrapper.
575
+ :param include_shadow_dom: Include all shadow roots. Equals to false if not specified.
576
+ """
577
+ _params: Dict[str, Any] = {}
578
+ if node_id is not None:
579
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
580
+ if backend_node_id is not None:
581
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
582
+ if object_id is not None:
583
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
584
+ if include_shadow_dom is not None:
585
+ _params['includeShadowDOM'] = encode(FieldMeta('', '', False, 'primitive'), include_shadow_dom)
586
+ _result = await self._target.send('DOM.getOuterHTML', _params)
587
+ return GetOuterHTMLReturn.from_json(_result)
588
+
589
+ async def get_relayout_boundary(self, *, node_id: NodeId) -> GetRelayoutBoundaryReturn:
590
+ """
591
+ Returns the id of the nearest ancestor that is a relayout boundary.
592
+ :param node_id: Id of the node.
593
+ """
594
+ _params: Dict[str, Any] = {}
595
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
596
+ _result = await self._target.send('DOM.getRelayoutBoundary', _params)
597
+ return GetRelayoutBoundaryReturn.from_json(_result)
598
+
599
+ async def get_search_results(self, *, search_id: str, from_index: int, to_index: int) -> GetSearchResultsReturn:
600
+ """
601
+ Returns search results from given `fromIndex` to given `toIndex` from the search with the given
602
+ identifier.
603
+ :param search_id: Unique search session identifier.
604
+ :param from_index: Start index of the search result to be returned.
605
+ :param to_index: End index of the search result to be returned.
606
+ """
607
+ _params: Dict[str, Any] = {}
608
+ _params['searchId'] = encode(FieldMeta('', '', False, 'primitive'), search_id)
609
+ _params['fromIndex'] = encode(FieldMeta('', '', False, 'primitive'), from_index)
610
+ _params['toIndex'] = encode(FieldMeta('', '', False, 'primitive'), to_index)
611
+ _result = await self._target.send('DOM.getSearchResults', _params)
612
+ return GetSearchResultsReturn.from_json(_result)
613
+
614
+ async def hide_highlight(self) -> None:
615
+ """Hides any highlight."""
616
+ _params: Dict[str, Any] = {}
617
+ _result = await self._target.send('DOM.hideHighlight', _params)
618
+ return None
619
+
620
+ async def highlight_node(self) -> None:
621
+ """Highlights DOM node."""
622
+ _params: Dict[str, Any] = {}
623
+ _result = await self._target.send('DOM.highlightNode', _params)
624
+ return None
625
+
626
+ async def highlight_rect(self) -> None:
627
+ """Highlights given rectangle."""
628
+ _params: Dict[str, Any] = {}
629
+ _result = await self._target.send('DOM.highlightRect', _params)
630
+ return None
631
+
632
+ async def mark_undoable_state(self) -> None:
633
+ """Marks last undoable state."""
634
+ _params: Dict[str, Any] = {}
635
+ _result = await self._target.send('DOM.markUndoableState', _params)
636
+ return None
637
+
638
+ async def move_to(self, *, node_id: NodeId, target_node_id: NodeId, insert_before_node_id: Optional[NodeId] = None) -> MoveToReturn:
639
+ """
640
+ Moves node into the new container, places it before the given anchor.
641
+ :param node_id: Id of the node to move.
642
+ :param target_node_id: Id of the element to drop the moved node into.
643
+ :param insert_before_node_id: Drop node before this one (if absent, the moved node becomes the last child of
644
+ `targetNodeId`).
645
+ """
646
+ _params: Dict[str, Any] = {}
647
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
648
+ _params['targetNodeId'] = encode(FieldMeta('', '', False, 'primitive'), target_node_id)
649
+ if insert_before_node_id is not None:
650
+ _params['insertBeforeNodeId'] = encode(FieldMeta('', '', False, 'primitive'), insert_before_node_id)
651
+ _result = await self._target.send('DOM.moveTo', _params)
652
+ return MoveToReturn.from_json(_result)
653
+
654
+ async def perform_search(self, *, query: str, include_user_agent_shadow_dom: Optional[bool] = None) -> PerformSearchReturn:
655
+ """
656
+ Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or
657
+ `cancelSearch` to end this search session.
658
+ :param query: Plain text or query selector or XPath search query.
659
+ :param include_user_agent_shadow_dom: True to search in user agent shadow DOM.
660
+ """
661
+ _params: Dict[str, Any] = {}
662
+ _params['query'] = encode(FieldMeta('', '', False, 'primitive'), query)
663
+ if include_user_agent_shadow_dom is not None:
664
+ _params['includeUserAgentShadowDOM'] = encode(FieldMeta('', '', False, 'primitive'), include_user_agent_shadow_dom)
665
+ _result = await self._target.send('DOM.performSearch', _params)
666
+ return PerformSearchReturn.from_json(_result)
667
+
668
+ async def push_node_by_path_to_frontend(self, *, path: str) -> PushNodeByPathToFrontendReturn:
669
+ """
670
+ Requests that the node is sent to the caller given its path. // FIXME, use XPath
671
+ :param path: Path to node in the proprietary format.
672
+ """
673
+ _params: Dict[str, Any] = {}
674
+ _params['path'] = encode(FieldMeta('', '', False, 'primitive'), path)
675
+ _result = await self._target.send('DOM.pushNodeByPathToFrontend', _params)
676
+ return PushNodeByPathToFrontendReturn.from_json(_result)
677
+
678
+ async def push_nodes_by_backend_ids_to_frontend(self, *, backend_node_ids: List[BackendNodeId]) -> PushNodesByBackendIdsToFrontendReturn:
679
+ """
680
+ Requests that a batch of nodes is sent to the caller given their backend node ids.
681
+ :param backend_node_ids: The array of backend node ids.
682
+ """
683
+ _params: Dict[str, Any] = {}
684
+ _params['backendNodeIds'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), backend_node_ids)
685
+ _result = await self._target.send('DOM.pushNodesByBackendIdsToFrontend', _params)
686
+ return PushNodesByBackendIdsToFrontendReturn.from_json(_result)
687
+
688
+ async def query_selector(self, *, node_id: NodeId, selector: str) -> QuerySelectorReturn:
689
+ """
690
+ Executes `querySelector` on a given node.
691
+ :param node_id: Id of the node to query upon.
692
+ :param selector: Selector string.
693
+ """
694
+ _params: Dict[str, Any] = {}
695
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
696
+ _params['selector'] = encode(FieldMeta('', '', False, 'primitive'), selector)
697
+ _result = await self._target.send('DOM.querySelector', _params)
698
+ return QuerySelectorReturn.from_json(_result)
699
+
700
+ async def query_selector_all(self, *, node_id: NodeId, selector: str) -> QuerySelectorAllReturn:
701
+ """
702
+ Executes `querySelectorAll` on a given node.
703
+ :param node_id: Id of the node to query upon.
704
+ :param selector: Selector string.
705
+ """
706
+ _params: Dict[str, Any] = {}
707
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
708
+ _params['selector'] = encode(FieldMeta('', '', False, 'primitive'), selector)
709
+ _result = await self._target.send('DOM.querySelectorAll', _params)
710
+ return QuerySelectorAllReturn.from_json(_result)
711
+
712
+ async def get_top_layer_elements(self) -> GetTopLayerElementsReturn:
713
+ """
714
+ Returns NodeIds of current top layer elements.
715
+ Top layer is rendered closest to the user within a viewport, therefore its elements always
716
+ appear on top of all other content.
717
+ """
718
+ _params: Dict[str, Any] = {}
719
+ _result = await self._target.send('DOM.getTopLayerElements', _params)
720
+ return GetTopLayerElementsReturn.from_json(_result)
721
+
722
+ async def get_element_by_relation(self, *, node_id: NodeId, relation: Literal['PopoverTarget', 'InterestTarget', 'CommandFor']) -> GetElementByRelationReturn:
723
+ """
724
+ Returns the NodeId of the matched element according to certain relations.
725
+ :param node_id: Id of the node from which to query the relation.
726
+ :param relation: Type of relation to get.
727
+ """
728
+ _params: Dict[str, Any] = {}
729
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
730
+ _params['relation'] = encode(FieldMeta('', '', False, 'primitive'), relation)
731
+ _result = await self._target.send('DOM.getElementByRelation', _params)
732
+ return GetElementByRelationReturn.from_json(_result)
733
+
734
+ async def redo(self) -> None:
735
+ """Re-does the last undone action."""
736
+ _params: Dict[str, Any] = {}
737
+ _result = await self._target.send('DOM.redo', _params)
738
+ return None
739
+
740
+ async def remove_attribute(self, *, node_id: NodeId, name: str) -> None:
741
+ """
742
+ Removes attribute with given name from an element with given id.
743
+ :param node_id: Id of the element to remove attribute from.
744
+ :param name: Name of the attribute to remove.
745
+ """
746
+ _params: Dict[str, Any] = {}
747
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
748
+ _params['name'] = encode(FieldMeta('', '', False, 'primitive'), name)
749
+ _result = await self._target.send('DOM.removeAttribute', _params)
750
+ return None
751
+
752
+ async def remove_node(self, *, node_id: NodeId) -> None:
753
+ """
754
+ Removes node with given id.
755
+ :param node_id: Id of the node to remove.
756
+ """
757
+ _params: Dict[str, Any] = {}
758
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
759
+ _result = await self._target.send('DOM.removeNode', _params)
760
+ return None
761
+
762
+ async def request_child_nodes(self, *, node_id: NodeId, depth: Optional[int] = None, pierce: Optional[bool] = None) -> None:
763
+ """
764
+ Requests that children of the node with given id are returned to the caller in form of
765
+ `setChildNodes` events where not only immediate children are retrieved, but all children down to
766
+ the specified depth.
767
+ :param node_id: Id of the node to get children for.
768
+ :param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
769
+ entire subtree or provide an integer larger than 0.
770
+ :param pierce: Whether or not iframes and shadow roots should be traversed when returning the sub-tree
771
+ (default is false).
772
+ """
773
+ _params: Dict[str, Any] = {}
774
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
775
+ if depth is not None:
776
+ _params['depth'] = encode(FieldMeta('', '', False, 'primitive'), depth)
777
+ if pierce is not None:
778
+ _params['pierce'] = encode(FieldMeta('', '', False, 'primitive'), pierce)
779
+ _result = await self._target.send('DOM.requestChildNodes', _params)
780
+ return None
781
+
782
+ async def request_node(self, *, object_id: Runtime_RemoteObjectId) -> RequestNodeReturn:
783
+ """
784
+ Requests that the node is sent to the caller given the JavaScript node object reference. All
785
+ nodes that form the path from the node to the root are also sent to the client as a series of
786
+ `setChildNodes` notifications.
787
+ :param object_id: JavaScript object id to convert into node.
788
+ """
789
+ _params: Dict[str, Any] = {}
790
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
791
+ _result = await self._target.send('DOM.requestNode', _params)
792
+ return RequestNodeReturn.from_json(_result)
793
+
794
+ async def resolve_node(self, *, node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_group: Optional[str] = None, execution_context_id: Optional[Runtime_ExecutionContextId] = None) -> ResolveNodeReturn:
795
+ """
796
+ Resolves the JavaScript node object for a given NodeId or BackendNodeId.
797
+ :param node_id: Id of the node to resolve.
798
+ :param backend_node_id: Backend identifier of the node to resolve.
799
+ :param object_group: Symbolic group name that can be used to release multiple objects.
800
+ :param execution_context_id: Execution context in which to resolve the node.
801
+ """
802
+ _params: Dict[str, Any] = {}
803
+ if node_id is not None:
804
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
805
+ if backend_node_id is not None:
806
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
807
+ if object_group is not None:
808
+ _params['objectGroup'] = encode(FieldMeta('', '', False, 'primitive'), object_group)
809
+ if execution_context_id is not None:
810
+ _params['executionContextId'] = encode(FieldMeta('', '', False, 'primitive'), execution_context_id)
811
+ _result = await self._target.send('DOM.resolveNode', _params)
812
+ return ResolveNodeReturn.from_json(_result)
813
+
814
+ async def set_attribute_value(self, *, node_id: NodeId, name: str, value: str) -> None:
815
+ """
816
+ Sets attribute for an element with given id.
817
+ :param node_id: Id of the element to set attribute for.
818
+ :param name: Attribute name.
819
+ :param value: Attribute value.
820
+ """
821
+ _params: Dict[str, Any] = {}
822
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
823
+ _params['name'] = encode(FieldMeta('', '', False, 'primitive'), name)
824
+ _params['value'] = encode(FieldMeta('', '', False, 'primitive'), value)
825
+ _result = await self._target.send('DOM.setAttributeValue', _params)
826
+ return None
827
+
828
+ async def set_attributes_as_text(self, *, node_id: NodeId, text: str, name: Optional[str] = None) -> None:
829
+ """
830
+ Sets attributes on element with given id. This method is useful when user edits some existing
831
+ attribute value and types in several attribute name/value pairs.
832
+ :param node_id: Id of the element to set attributes for.
833
+ :param text: Text with a number of attributes. Will parse this text using HTML parser.
834
+ :param name: Attribute name to replace with new attributes derived from text in case text parsed
835
+ successfully.
836
+ """
837
+ _params: Dict[str, Any] = {}
838
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
839
+ _params['text'] = encode(FieldMeta('', '', False, 'primitive'), text)
840
+ if name is not None:
841
+ _params['name'] = encode(FieldMeta('', '', False, 'primitive'), name)
842
+ _result = await self._target.send('DOM.setAttributesAsText', _params)
843
+ return None
844
+
845
+ async def set_file_input_files(self, *, files: List[str], node_id: Optional[NodeId] = None, backend_node_id: Optional[BackendNodeId] = None, object_id: Optional[Runtime_RemoteObjectId] = None) -> None:
846
+ """
847
+ Sets files for the given file input element.
848
+ :param files: Array of file paths to set.
849
+ :param node_id: Identifier of the node.
850
+ :param backend_node_id: Identifier of the backend node.
851
+ :param object_id: JavaScript object id of the node wrapper.
852
+ """
853
+ _params: Dict[str, Any] = {}
854
+ _params['files'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), files)
855
+ if node_id is not None:
856
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
857
+ if backend_node_id is not None:
858
+ _params['backendNodeId'] = encode(FieldMeta('', '', False, 'primitive'), backend_node_id)
859
+ if object_id is not None:
860
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
861
+ _result = await self._target.send('DOM.setFileInputFiles', _params)
862
+ return None
863
+
864
+ async def set_node_stack_traces_enabled(self, *, enable: bool) -> None:
865
+ """
866
+ Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled.
867
+ :param enable: Enable or disable.
868
+ """
869
+ _params: Dict[str, Any] = {}
870
+ _params['enable'] = encode(FieldMeta('', '', False, 'primitive'), enable)
871
+ _result = await self._target.send('DOM.setNodeStackTracesEnabled', _params)
872
+ return None
873
+
874
+ async def get_node_stack_traces(self, *, node_id: NodeId) -> GetNodeStackTracesReturn:
875
+ """
876
+ Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
877
+ :param node_id: Id of the node to get stack traces for.
878
+ """
879
+ _params: Dict[str, Any] = {}
880
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
881
+ _result = await self._target.send('DOM.getNodeStackTraces', _params)
882
+ return GetNodeStackTracesReturn.from_json(_result)
883
+
884
+ async def get_file_info(self, *, object_id: Runtime_RemoteObjectId) -> GetFileInfoReturn:
885
+ """
886
+ Returns file information for the given
887
+ File wrapper.
888
+ :param object_id: JavaScript object id of the node wrapper.
889
+ """
890
+ _params: Dict[str, Any] = {}
891
+ _params['objectId'] = encode(FieldMeta('', '', False, 'primitive'), object_id)
892
+ _result = await self._target.send('DOM.getFileInfo', _params)
893
+ return GetFileInfoReturn.from_json(_result)
894
+
895
+ async def get_detached_dom_nodes(self) -> GetDetachedDomNodesReturn:
896
+ """Returns list of detached nodes"""
897
+ _params: Dict[str, Any] = {}
898
+ _result = await self._target.send('DOM.getDetachedDomNodes', _params)
899
+ return GetDetachedDomNodesReturn.from_json(_result)
900
+
901
+ async def set_inspected_node(self, *, node_id: NodeId) -> None:
902
+ """
903
+ Enables console to refer to the node with given id via $x (see Command Line API for more details
904
+ $x functions).
905
+ :param node_id: DOM node id to be accessible by means of $x command line API.
906
+ """
907
+ _params: Dict[str, Any] = {}
908
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
909
+ _result = await self._target.send('DOM.setInspectedNode', _params)
910
+ return None
911
+
912
+ async def set_node_name(self, *, node_id: NodeId, name: str) -> SetNodeNameReturn:
913
+ """
914
+ Sets node name for a node with given id.
915
+ :param node_id: Id of the node to set name for.
916
+ :param name: New node's name.
917
+ """
918
+ _params: Dict[str, Any] = {}
919
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
920
+ _params['name'] = encode(FieldMeta('', '', False, 'primitive'), name)
921
+ _result = await self._target.send('DOM.setNodeName', _params)
922
+ return SetNodeNameReturn.from_json(_result)
923
+
924
+ async def set_node_value(self, *, node_id: NodeId, value: str) -> None:
925
+ """
926
+ Sets node value for a node with given id.
927
+ :param node_id: Id of the node to set value for.
928
+ :param value: New node's value.
929
+ """
930
+ _params: Dict[str, Any] = {}
931
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
932
+ _params['value'] = encode(FieldMeta('', '', False, 'primitive'), value)
933
+ _result = await self._target.send('DOM.setNodeValue', _params)
934
+ return None
935
+
936
+ async def set_outer_html(self, *, node_id: NodeId, outer_html: str) -> None:
937
+ """
938
+ Sets node HTML markup, returns new node id.
939
+ :param node_id: Id of the node to set markup for.
940
+ :param outer_html: Outer HTML markup to set.
941
+ """
942
+ _params: Dict[str, Any] = {}
943
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
944
+ _params['outerHTML'] = encode(FieldMeta('', '', False, 'primitive'), outer_html)
945
+ _result = await self._target.send('DOM.setOuterHTML', _params)
946
+ return None
947
+
948
+ async def undo(self) -> None:
949
+ """Undoes the last performed action."""
950
+ _params: Dict[str, Any] = {}
951
+ _result = await self._target.send('DOM.undo', _params)
952
+ return None
953
+
954
+ async def get_frame_owner(self, *, frame_id: Page_FrameId) -> GetFrameOwnerReturn:
955
+ """
956
+ Returns iframe node that owns iframe with the given domain.
957
+ :param frame_id:
958
+ """
959
+ _params: Dict[str, Any] = {}
960
+ _params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
961
+ _result = await self._target.send('DOM.getFrameOwner', _params)
962
+ return GetFrameOwnerReturn.from_json(_result)
963
+
964
+ async def get_container_for_node(self, *, node_id: NodeId, container_name: Optional[str] = None, physical_axes: Optional[PhysicalAxes] = None, logical_axes: Optional[LogicalAxes] = None, queries_scroll_state: Optional[bool] = None, queries_anchored: Optional[bool] = None) -> GetContainerForNodeReturn:
965
+ """
966
+ Returns the query container of the given node based on container query
967
+ conditions: containerName, physical and logical axes, and whether it queries
968
+ scroll-state or anchored elements. If no axes are provided and
969
+ queriesScrollState is false, the style container is returned, which is the
970
+ direct parent or the closest element with a matching container-name.
971
+ :param node_id:
972
+ :param container_name:
973
+ :param physical_axes:
974
+ :param logical_axes:
975
+ :param queries_scroll_state:
976
+ :param queries_anchored:
977
+ """
978
+ _params: Dict[str, Any] = {}
979
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
980
+ if container_name is not None:
981
+ _params['containerName'] = encode(FieldMeta('', '', False, 'primitive'), container_name)
982
+ if physical_axes is not None:
983
+ _params['physicalAxes'] = encode(FieldMeta('', '', False, 'enum', ref='DOM.PhysicalAxes'), physical_axes)
984
+ if logical_axes is not None:
985
+ _params['logicalAxes'] = encode(FieldMeta('', '', False, 'enum', ref='DOM.LogicalAxes'), logical_axes)
986
+ if queries_scroll_state is not None:
987
+ _params['queriesScrollState'] = encode(FieldMeta('', '', False, 'primitive'), queries_scroll_state)
988
+ if queries_anchored is not None:
989
+ _params['queriesAnchored'] = encode(FieldMeta('', '', False, 'primitive'), queries_anchored)
990
+ _result = await self._target.send('DOM.getContainerForNode', _params)
991
+ return GetContainerForNodeReturn.from_json(_result)
992
+
993
+ async def get_querying_descendants_for_container(self, *, node_id: NodeId) -> GetQueryingDescendantsForContainerReturn:
994
+ """
995
+ Returns the descendants of a container query container that have
996
+ container queries against this container.
997
+ :param node_id: Id of the container node to find querying descendants from.
998
+ """
999
+ _params: Dict[str, Any] = {}
1000
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
1001
+ _result = await self._target.send('DOM.getQueryingDescendantsForContainer', _params)
1002
+ return GetQueryingDescendantsForContainerReturn.from_json(_result)
1003
+
1004
+ async def get_anchor_element(self, *, node_id: NodeId, anchor_specifier: Optional[str] = None) -> GetAnchorElementReturn:
1005
+ """
1006
+ Returns the target anchor element of the given anchor query according to
1007
+ https://www.w3.org/TR/css-anchor-position-1/#target.
1008
+ :param node_id: Id of the positioned element from which to find the anchor.
1009
+ :param anchor_specifier: An optional anchor specifier, as defined in
1010
+ https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier.
1011
+ If not provided, it will return the implicit anchor element for
1012
+ the given positioned element.
1013
+ """
1014
+ _params: Dict[str, Any] = {}
1015
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
1016
+ if anchor_specifier is not None:
1017
+ _params['anchorSpecifier'] = encode(FieldMeta('', '', False, 'primitive'), anchor_specifier)
1018
+ _result = await self._target.send('DOM.getAnchorElement', _params)
1019
+ return GetAnchorElementReturn.from_json(_result)
1020
+
1021
+ async def force_show_popover(self, *, node_id: NodeId, enable: bool) -> ForceShowPopoverReturn:
1022
+ """
1023
+ When enabling, this API force-opens the popover identified by nodeId
1024
+ and keeps it open until disabled.
1025
+ :param node_id: Id of the popover HTMLElement
1026
+ :param enable: If true, opens the popover and keeps it open. If false, closes the
1027
+ popover if it was previously force-opened.
1028
+ """
1029
+ _params: Dict[str, Any] = {}
1030
+ _params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
1031
+ _params['enable'] = encode(FieldMeta('', '', False, 'primitive'), enable)
1032
+ _result = await self._target.send('DOM.forceShowPopover', _params)
1033
+ return ForceShowPopoverReturn.from_json(_result)