zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
U
[±d^ã @s¼ddlmZddlmZmZddlmZddlZddlZddl    m
Z
ddl    m Z Gdd    „d    e ƒZ Gd
d „d e ƒZeGd d „d ƒƒZeGdd„dƒƒZGdd„deƒZeGdd„dƒƒZd    ddœdd„Zdmd    dddœdd„Zddœdd„Zd    d dœd!d"„Zdnd    d#dd$œd%d&„Zdodd#d#d'd(d)œd*d+„Zd,dœd-d.„Zdpd/d0d0d1ddddd2d3œ    d4d5„Zdqd6d7dd8œd9d:„Zd;dd<œd=d>„Zdrd7d?dœd@dA„ZdsdBdCdDœdEdF„Zdtd/d6d7ddGœdHdI„Z dudJdJddBddKœdLdM„Z!dvd    dJdBddNœdOdP„Z"dwdJdBddQœdRdS„Z#dTddUœdVdW„Z$edXƒeGdYdZ„dZƒƒƒZ%ed[ƒeGd\d]„d]ƒƒƒZ&ed^ƒeGd_d`„d`ƒƒƒZ'edaƒeGdbdc„dcƒƒƒZ(eddƒeGdedf„dfƒƒƒZ)edgƒeGdhdi„diƒƒƒZ*edjƒeGdkdl„dlƒƒƒZ+dS)xé)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassN)Úbrowser)Úpagecs>eZdZddœdd„Zedddœdd„ƒZ‡fdd    „Z‡ZS)
ÚTargetIDÚstr©ÚreturncCs|S©N©©Úselfrrúed:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v112/target.pyÚto_jsonszTargetID.to_json©Újsonr cCs||ƒSr r©ÚclsrrrrÚ    from_jsonszTargetID.from_jsoncsd tƒ ¡¡S)Nz TargetID({})©ÚformatÚsuperÚ__repr__r©Ú    __class__rrrszTargetID.__repr__)Ú__name__Ú
__module__Ú __qualname__rÚ classmethodrrÚ __classcell__rrrrr    sr    csBeZdZdZddœdd„Zedddœdd„ƒZ‡fd    d
„Z‡ZS) Ú    SessionIDz:
    Unique identifier of attached debugging session.
    r
r cCs|Sr rrrrrr szSessionID.to_jsonrcCs||ƒSr rrrrrr#szSessionID.from_jsoncsd tƒ ¡¡S)Nz SessionID({})rrrrrr'szSessionID.__repr__©    rrr Ú__doc__rr!rrr"rrrrr#s
r#c@s‚eZdZUded<ded<ded<ded<ded<ded    <d
Zd ed <d
Zd ed<d
Zded<d
Zded<dd„Ze    dd„ƒZ
d
S)Ú
TargetInfor    Ú    target_idr
Útype_ÚtitleÚurlÚboolÚattachedÚcan_access_openerNútyping.Optional[TargetID]Ú    opener_idztyping.Optional[page.FrameId]Úopener_frame_idú)typing.Optional[browser.BrowserContextID]Úbrowser_context_idútyping.Optional[str]ÚsubtypecCs¦tƒ}|j ¡|d<|j|d<|j|d<|j|d<|j|d<|j|d<|jdk    r^|j ¡|d<|j    dk    rv|j     ¡|d<|j
dk    rŽ|j
 ¡|d    <|j dk    r¢|j |d
<|S) NÚtargetIdÚtyper)r*r,ÚcanAccessOpenerÚopenerIdÚ openerFrameIdÚbrowserContextIdr4) Údictr'rr(r)r*r,r-r/r0r2r4©rrrrrrGs 
 
 
 
 
 
 
 
 
 
zTargetInfo.to_jsonc Cs¨|t |d¡t|dƒt|dƒt|dƒt|dƒt|dƒd|krVt |d¡ndd|krptj |d¡ndd    |krŠtj |d    ¡ndd
|kr t|d
ƒndd 
S) Nr5r6r)r*r,r7r8r9r:r4)
r'r(r)r*r,r-r/r0r2r4)r    rr
r+rZFrameIdrÚBrowserContextIDrrrrrYs 
 
 
 
 
özTargetInfo.from_json) rrr Ú__annotations__r/r0r2r4rr!rrrrrr&+s
    r&c@s>eZdZUdZdZded<dZded<dd„Zed    d
„ƒZ    dS) Ú FilterEntryzI
    A filter used by target query/discovery/auto-attach operations.
    Nútyping.Optional[bool]Úexcluder3r(cCs2tƒ}|jdk    r|j|d<|jdk    r.|j|d<|S)NrAr6)r;rAr(r<rrrrts 
 
 
 
zFilterEntry.to_jsoncCs4|d|krt|dƒndd|kr,t|dƒnddS)NrAr6)rAr()r+r
rrrrr|sþzFilterEntry.from_json)
rrr r%rAr>r(rr!rrrrrr?is
  r?csBeZdZdZddœdd„Zedddœdd„ƒZ‡fd    d
„Z‡ZS) Ú TargetFiltera•
    The entries in TargetFilter are matched sequentially against targets and
    the first entry that matches determines if the target is included or not,
    depending on the value of ``exclude`` field in the entry.
    If filter is not specified, the one assumed is
    [{type: "browser", exclude: true}, {type: "tab", exclude: true}, {}]
    (i.e. include everything but ``browser`` and ``tab``).
    ztyping.List[FilterEntry]r cCs|Sr rrrrrrszTargetFilter.to_jsonrcCs||ƒSr rrrrrrszTargetFilter.from_jsoncsd tƒ ¡¡S)NzTargetFilter({})rrrrrr”szTargetFilter.__repr__r$rrrrrB„s
rBc@s2eZdZUded<ded<dd„Zedd„ƒZd    S)
ÚRemoteLocationr
ÚhostÚintÚportcCstƒ}|j|d<|j|d<|S)NrDrF)r;rDrFr<rrrržs
 
zRemoteLocation.to_jsoncCs|t|dƒt|dƒdS)NrDrF)rDrF)r
rErrrrr¤s
 
þzRemoteLocation.from_jsonN)rrr r>rr!rrrrrrC˜s
 
rCz0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r'r ccs&tƒ}| ¡|d<d|dœ}|V}dS)z@
    Activates (focuses) the target.
 
    :param target_id:
    r5zTarget.activateTarget©ÚmethodÚparamsN©r;r©r'rIÚcmd_dictrrrrÚactivate_target¬s  þrMr@z5typing.Generator[T_JSON_DICT, T_JSON_DICT, SessionID])r'Úflattenr ccs@tƒ}| ¡|d<|dk    r"||d<d|dœ}|V}t |d¡S)aZ
    Attaches to the target with given id.
 
    :param target_id:
    :param flatten: *(Optional)* Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
    :returns: Id assigned to the session.
    r5NrNzTarget.attachToTargetrGÚ    sessionId)r;rr#r)r'rNrIrLrrrrÚattach_to_target½s  þrPr ccsddi}|V}t |d¡S)z‰
    Attaches to the browser target, only uses flat sessionId mode.
 
    **EXPERIMENTAL**
 
    :returns: Id assigned to the session.
    rHzTarget.attachToBrowserTargetrO)r#r©rLrrrrÚattach_to_browser_targetÔs
    ÿrRz0typing.Generator[T_JSON_DICT, T_JSON_DICT, bool]ccs.tƒ}| ¡|d<d|dœ}|V}t|dƒS)z¾
    Closes the target. If the target is a page that gets closed too.
 
    :param target_id:
    :returns: Always set to true. If an error occurs, the response indicates protocol error.
    r5zTarget.closeTargetrGÚsuccess)r;rr+rKrrrÚ close_targetãs     þrTr3)r'Ú binding_namer ccs6tƒ}| ¡|d<|dk    r"||d<d|dœ}|V}dS)a@
    Inject object to the target's main frame that provides a communication
    channel with browser target.
 
    Injected object will be available as ``window[bindingName]``.
 
    The object has the follwing API:
    - ``binding.send(json)`` - a method to send messages over the remote debugging protocol
    - ``binding.onmessage = json => handleMessage(json)`` - a callback that will be called for the protocol notifications and command responses.
 
    **EXPERIMENTAL**
 
    :param target_id:
    :param binding_name: *(Optional)* Binding name, 'cdp' if not specified.
    r5NZ bindingNamezTarget.exposeDevToolsProtocolrGrJ)r'rUrIrLrrrrÚexpose_dev_tools_protocolös þrVz!typing.Optional[typing.List[str]]zDtyping.Generator[T_JSON_DICT, T_JSON_DICT, browser.BrowserContextID])Údispose_on_detachÚ proxy_serverÚproxy_bypass_listÚ%origins_with_universal_network_accessr ccsptƒ}|dk    r||d<|dk    r&||d<|dk    r6||d<|dk    rPdd„|Dƒ|d<d|d    œ}|V}tj |d
¡S) aÀ
    Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than
    one.
 
    **EXPERIMENTAL**
 
    :param dispose_on_detach: *(Optional)* If specified, disposes this context when debugging session disconnects.
    :param proxy_server: *(Optional)* Proxy server, similar to the one passed to --proxy-server
    :param proxy_bypass_list: *(Optional)* Proxy bypass list, similar to the one passed to --proxy-bypass-list
    :param origins_with_universal_network_access: *(Optional)* An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored.
    :returns: The id of the context created.
    NZdisposeOnDetachÚ proxyServerZproxyBypassListcSsg|]}|‘qSrr©Ú.0ÚirrrÚ
<listcomp>.sz*create_browser_context.<locals>.<listcomp>Z!originsWithUniversalNetworkAccesszTarget.createBrowserContextrGr:)r;rr=r)rWrXrYrZrIrLrrrrÚcreate_browser_contextsþr`zQtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[browser.BrowserContextID]]ccs ddi}|V}dd„|dDƒS)z¡
    Returns all browser contexts created with ``Target.createBrowserContext`` method.
 
    **EXPERIMENTAL**
 
    :returns: An array of browser context ids.
    rHzTarget.getBrowserContextscSsg|]}tj |¡‘qSr)rr=rr\rrrr_Csz(get_browser_contexts.<locals>.<listcomp>ZbrowserContextIdsrrQrrrÚget_browser_contexts7s
    ÿrar
ztyping.Optional[int]r1z4typing.Generator[T_JSON_DICT, T_JSON_DICT, TargetID])    r*ÚwidthÚheightr2Úenable_begin_frame_controlÚ
new_windowÚ
backgroundÚfor_tabr c cs tƒ}||d<|dk    r||d<|dk    r.||d<|dk    rB| ¡|d<|dk    rR||d<|dk    rb||d<|dk    rr||d<|dk    r‚||d    <d
|d œ}    |    V}
t |
d ¡S) aÇ
    Creates a new page.
 
    :param url: The initial URL the page will be navigated to. An empty string indicates about:blank.
    :param width: *(Optional)* Frame width in DIP (headless chrome only).
    :param height: *(Optional)* Frame height in DIP (headless chrome only).
    :param browser_context_id: **(EXPERIMENTAL)** *(Optional)* The browser context to create the page in.
    :param enable_begin_frame_control: **(EXPERIMENTAL)** *(Optional)* Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).
    :param new_window: *(Optional)* Whether to create a new Window or Tab (chrome-only, false by default).
    :param background: *(Optional)* Whether to create the target in background or foreground (chrome-only, false by default).
    :param for_tab: **(EXPERIMENTAL)** *(Optional)* Whether to create the target of type "tab".
    :returns: The id of the page opened.
    r*Nrbrcr:ZenableBeginFrameControlZ    newWindowrfZforTabzTarget.createTargetrGr5)r;rr    r) r*rbrcr2rdrerfrgrIrLrrrrÚ create_targetFs* þrhztyping.Optional[SessionID]r.)Ú
session_idr'r ccsBtƒ}|dk    r| ¡|d<|dk    r.| ¡|d<d|dœ}|V}dS)z
    Detaches session with given id.
 
    :param session_id: *(Optional)* Session to detach.
    :param target_id: *(Optional)* Deprecated.
    NrOr5zTarget.detachFromTargetrGrJ)rir'rIrLrrrrÚdetach_from_targetus
  þrjzbrowser.BrowserContextID)r2r ccs&tƒ}| ¡|d<d|dœ}|V}dS)z®
    Deletes a BrowserContext. All the belonging pages will be closed without calling their
    beforeunload hooks.
 
    **EXPERIMENTAL**
 
    :param browser_context_id:
    r:zTarget.disposeBrowserContextrGNrJ)r2rIrLrrrrÚdispose_browser_context‹s  þrkz6typing.Generator[T_JSON_DICT, T_JSON_DICT, TargetInfo]ccs8tƒ}|dk    r| ¡|d<d|dœ}|V}t |d¡S)zv
    Returns information about a target.
 
    **EXPERIMENTAL**
 
    :param target_id: *(Optional)*
    :returns: 
    Nr5zTarget.getTargetInforGÚ
targetInfo)r;rr&rrKrrrÚget_target_infoŸs  þrmztyping.Optional[TargetFilter]zCtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[TargetInfo]])Úfilter_r ccs<tƒ}|dk    r| ¡|d<d|dœ}|V}dd„|dDƒS)a9
    Retrieves a list of available targets.
 
    :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be reported. If filter is not specified and target discovery is currently enabled, a filter used for target discovery is used for consistency.
    :returns: The list of targets.
    NÚfilterzTarget.getTargetsrGcSsg|]}t |¡‘qSr©r&rr\rrrr_Æszget_targets.<locals>.<listcomp>Z targetInfosrJ)rnrIrLrrrrÚ get_targetsµs     þrq)Úmessagerir'r ccsJtƒ}||d<|dk    r"| ¡|d<|dk    r6| ¡|d<d|dœ}|V}dS)a+
    Sends protocol message over session with given id.
    Consider using flat mode instead; see commands attachToTarget, setAutoAttach,
    and crbug.com/991325.
 
    :param message:
    :param session_id: *(Optional)* Identifier of the session.
    :param target_id: *(Optional)* Deprecated.
    rrNrOr5zTarget.sendMessageToTargetrGrJ)rrrir'rIrLrrrrÚsend_message_to_targetÉs  þrsr+)Ú auto_attachÚwait_for_debugger_on_startrNrnr ccsNtƒ}||d<||d<|dk    r&||d<|dk    r:| ¡|d<d|dœ}|V}dS)aÓ
    Controls whether to automatically attach to new targets which are considered to be related to
    this one. When turned on, attaches to all existing related targets as well. When turned off,
    automatically detaches from all currently attached targets.
    This also clears all targets added by ``autoAttachRelated`` from the list of targets to watch
    for creation of related targets.
 
    **EXPERIMENTAL**
 
    :param auto_attach: Whether to auto-attach to related targets.
    :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets.
    :param flatten: *(Optional)* Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
    :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached.
    Z
autoAttachÚwaitForDebuggerOnStartNrNrozTarget.setAutoAttachrGrJ)rtrurNrnrIrLrrrrÚset_auto_attachäs þrw)r'rurnr ccsBtƒ}| ¡|d<||d<|dk    r.| ¡|d<d|dœ}|V}dS)aå
    Adds the specified target to the list of targets that will be monitored for any related target
    creation (such as child frames, child workers and new versions of service worker) and reported
    through ``attachedToTarget``. The specified target is also auto-attached.
    This cancels the effect of any previous ``setAutoAttach`` and is also cancelled by subsequent
    ``setAutoAttach``. Only available at the Browser target.
 
    **EXPERIMENTAL**
 
    :param target_id:
    :param wait_for_debugger_on_start: Whether to pause new targets when attaching to them. Use ```Runtime.runIfWaitingForDebugger``` to run paused targets.
    :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached.
    r5rvNrozTarget.autoAttachRelatedrGrJ)r'rurnrIrLrrrrÚauto_attach_relateds  þrx)Údiscoverrnr ccs6tƒ}||d<|dk    r"| ¡|d<d|dœ}|V}dS)al
    Controls whether to discover available targets and notify via
    ``targetCreated/targetInfoChanged/targetDestroyed`` events.
 
    :param discover: Whether to discover available targets.
    :param filter_: **(EXPERIMENTAL)** *(Optional)* Only targets matching filter will be attached. If ```discover```` is false, ````filter``` must be omitted or empty.
    ryNrozTarget.setDiscoverTargetsrGrJ)ryrnrIrLrrrrÚset_discover_targets$s  þrzztyping.List[RemoteLocation])Ú    locationsr ccs,tƒ}dd„|Dƒ|d<d|dœ}|V}dS)z»
    Enables target discovery for the specified locations, when ``setDiscoverTargets`` was set to
    ``true``.
 
    **EXPERIMENTAL**
 
    :param locations: List of remote locations.
    cSsg|] }| ¡‘qSr)rr\rrrr_Fsz(set_remote_locations.<locals>.<listcomp>r{zTarget.setRemoteLocationsrGN)r;)r{rIrLrrrrÚset_remote_locations:s þr|zTarget.attachedToTargetc@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) ÚAttachedToTargetzt
    **EXPERIMENTAL**
 
    Issued when attached to target because of auto-attach or ``attachToTarget`` command.
    r#rir&Ú target_infor+Úwaiting_for_debuggerrrcCs*|t |d¡t |d¡t|dƒdS)NrOrlZwaitingForDebugger)rir~r)r#rr&r+rrrrr[s
 
ýzAttachedToTarget.from_jsonN©rrr r%r>r!rrrrrr}Ns
r}zTarget.detachedFromTargetc@s6eZdZUdZded<ded<edddœdd    „ƒZd
S) ÚDetachedFromTargetzÔ
    **EXPERIMENTAL**
 
    Issued when detached from target for any reason (including ``detachFromTarget`` command). Can be
    issued multiple times per target if multiple sessions have been attached to it.
    r#rir.r'rrcCs,|t |d¡d|kr$t |d¡nddS)NrOr5)rir')r#rr    rrrrrrs þzDetachedFromTarget.from_jsonNr€rrrrrds
 
rz Target.receivedMessageFromTargetc@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) ÚReceivedMessageFromTargetzz
    Notifies about a new protocol message received from the session (as reported in
    ``attachedToTarget`` event).
    r#rir
rrr.r'rrcCs6|t |d¡t|dƒd|kr.t |d¡nddS)NrOrrr5)rirrr')r#rr
r    rrrrr‡s
 
ýz#ReceivedMessageFromTarget.from_jsonNr€rrrrr‚zs
r‚zTarget.targetCreatedc@s.eZdZUdZded<edddœdd„ƒZdS)    Ú TargetCreatedz>
    Issued when a possible inspection target is created.
    r&r~rrcCs|t |d¡dS©Nrl)r~rprrrrr˜s ÿzTargetCreated.from_jsonNr€rrrrrƒs
rƒzTarget.targetDestroyedc@s.eZdZUdZded<edddœdd„ƒZdS)    ÚTargetDestroyedz,
    Issued when a target is destroyed.
    r    r'rrcCs|t |d¡dS)Nr5)r')r    rrrrrr§s ÿzTargetDestroyed.from_jsonNr€rrrrr…Ÿs
r…zTarget.targetCrashedc@s>eZdZUdZded<ded<ded<eddd    œd
d „ƒZd S) Ú TargetCrashedz+
    Issued when a target has crashed.
    r    r'r
ÚstatusrEÚ
error_coderrcCs(|t |d¡t|dƒt|dƒdS)Nr5r‡Z    errorCode)r'r‡rˆ)r    rr
rErrrrrºs
 
 
ýzTargetCrashed.from_jsonNr€rrrrr†®s
r†zTarget.targetInfoChangedc@s.eZdZUdZded<edddœdd„ƒZdS)    ÚTargetInfoChangedz‹
    Issued when some information about a target has changed. This only happens between
    ``targetCreated`` and ``targetDestroyed``.
    r&r~rrcCs|t |d¡dSr„rprrrrrÌs ÿzTargetInfoChanged.from_jsonNr€rrrrr‰Ãs
r‰)N)N)NNNN)NNNNNNN)NN)N)N)NN)NN)N)N),Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingÚrrr
r    r#r&r?ÚlistrBrCrMrPrRrTrVr`rarhrjrkrmrqrsrwrxrzr|r}rr‚rƒr…r†r‰rrrrÚ<module>s˜     =þþü#ø 0þÿÿýü%ý þ