zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
\±d£ã@s†ddlmZddlZddlmZddlmZddlm    Z
ddl m Z ddl mZddlmZdd    lmZej ¡ZGd
d „d e
ƒZ    dS) éN)ÚWebDriverException)ÚDesiredCapabilities)Ú    WebDriveré)ÚOptions)ÚSafariRemoteConnection)ÚDEFAULT_EXECUTABLE_PATH)ÚServicec    sbeZdZdZdededddddf    eeddœ‡fdd„ Z‡fd    d
„Z    d d „Z
d d„Z dd„Z ‡Z S)rz>Controls the SafariDriver and allows you to drive the browser.rFTN)ÚoptionsÚserviceÚreturnc
sè|rtjdtdd|tkr,tjdtdd|r@tjdtdd|tkrXtjdtdd|rltjdtdd|s€tjdtdd|r”tjd    tdd||_|    p¬t||||d
|_|s¾|j ¡t    |jj
|d }
t ƒj |
|d d |_ dS)aCreates a new Safari driver instance and launches or finds a running
        safaridriver service.
 
        :Args:
         - port - The port on which the safaridriver service should listen for new connections. If zero, a free port will be found.
         - executable_path - Path to a custom safaridriver executable to be used. If absent, /usr/bin/safaridriver is used.
         - reuse_service - If True, do not spawn a safaridriver instance; instead, connect to an already-running service that was launched externally.
         - desired_capabilities: Dictionary object with desired capabilities (Can be used to provide various Safari switches).
         - quiet - If True, the driver's stdout and stderr is suppressed.
         - keep_alive - Whether to configure SafariRemoteConnection to use
             HTTP keep-alive. Defaults to True.
         - service_args : List of args to pass to the safaridriver service
         - service - Service object for handling the browser driver if you need to pass extra details
        z=port has been deprecated, please set it via the service classé)Ú
stacklevelzKexecutable_path has been deprecated, please use the Options class to set itzIreuse_service has been deprecated, please use the Service class to set itzPdesired_capabilities has been deprecated, please use the Options class to set itzAquiet has been deprecated, please use the Service class to set itzFkeep_alive has been deprecated, please use the Service class to set itzHservice_args has been deprecated, please use the Service class to set it)ÚportÚquietÚ service_args)Zremote_server_addrÚ
keep_alive)Zcommand_executorr
FN)ÚwarningsÚwarnÚDeprecationWarningrÚDEFAULT_SAFARI_CAPSÚ_reuse_servicer    r ÚstartrZ service_urlÚsuperÚ__init__Z
_is_remote) ÚselfrZexecutable_pathZ reuse_serviceZdesired_capabilitiesrrrr
r Úexecutor©Ú    __class__©úZd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/safari/webdriver.pyr$sbÿýýýÿýý
zWebDriver.__init__csBz*ztƒ ¡Wntjk
r&YnXW5|js<|j ¡XdS)zuCloses the browser and shuts down the SafariDriver executable that
        is started when starting the SafariDriver.N)rr ÚstoprÚquitÚ http_clientÚ BadStatusLine©rrrr r"rs 
zWebDriver.quitcCs.t|tƒstdƒ‚||i}| dd|i¡dS)Nz;Value of a session permission must be set to True or False.ZSET_PERMISSIONSÚ permissions)Ú
isinstanceÚboolrÚexecute)rÚ
permissionÚvalueÚpayloadrrr Úset_permissions
zWebDriver.set_permissioncCsD| d¡d}|d}|sdS||kr*dS||}t|tƒs@dS|S)NZGET_PERMISSIONSr+r&)r)r'r()rr*r,r&r+rrr Úget_permission‰s
zWebDriver.get_permissioncCs| d¡| d¡dS)NZATTACH_DEBUGGERz    debugger;)r)Zexecute_scriptr%rrr Údebug™s
zWebDriver.debug)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrr    rr"r-r.r/Ú __classcell__rrrr r!s&ö    õN r)Ú http.clientÚclientr#rZselenium.common.exceptionsrZ.selenium.webdriver.common.desired_capabilitiesrZ#selenium.webdriver.remote.webdriverrZRemoteWebDriverr
rZremote_connectionrr rr    ZSAFARIÚcopyrrrrr Ú<module>s