
    Y j                     b    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr   " S S\5      rg	)
    )WebDriverException)DriverFinder)LocalWebDriver)Options)SafariRemoteConnection)Servicec            	       t   ^  \ rS rSrSr   SS\S-  S\S-  S\SS4U 4S jjjrU 4S	 jr	S
 r
S rS rSrU =r$ )	WebDriver   z>Controls the SafariDriver and allows you to drive the browser.Noptionsservice
keep_alivereturnc                 `  > U(       a  UO	[        5       U l        U(       a  UO	[        5       U l        U R                  R	                  5       =(       d.    [        U R                  U R                  5      R                  5       U R                  l        U R                  R                  (       d  U R                  R                  5         [        U R                  R                  UU R                  R                  S9n [        TU ]9  X@R                  S9  g! [         a    U R!                  5         e f = f)a3  Create a new Safari driver instance and launch or find a running safaridriver service.

Args:
    options: Instance of Options.
    service: Service object for handling the browser driver if you need to pass extra details.
    keep_alive: Whether to configure SafariRemoteConnection to use HTTP keep-alive.
)remote_server_addrr   ignore_proxy)command_executorr   N)r   r   r   r   env_pathr   get_driver_pathpathreuse_servicestartr   service_url_ignore_local_proxysuper__init__	Exceptionquit)selfr   r   r   executor	__class__s        t/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/selenium/webdriver/safari/webdriver.pyr   WebDriver.__init__   s     #*wwy")wwy LL113q|DLLRVR^R^7_7o7o7q||))LL )#||77!99
	GhM 	IIK	s   9D D-c                 &  >  [         TU ]  5         U R                  R                  (       d  U R                  R                  5         gg! [         a     NCf = f! U R                  R                  (       d  U R                  R                  5         f f = f)z>Closes the browser and shuts down the SafariDriver executable.N)r   r   r   r   r   stop)r   r!   s    r"   r   WebDriver.quit>   sn    	$GLN
 <<--!!# .	  		 <<--!!# .s#   A 
AA AA 8Bc                 r    [        U[        5      (       d  [        S5      eX0nU R                  SSU05        g )Nz;Value of a session permission must be set to True or False.SET_PERMISSIONSpermissions)
isinstanceboolr   execute)r   
permissionvaluepayloads       r"   set_permissionWebDriver.set_permissionM   s7    %&&$%bcc%&(@A    c                     U R                  S5      S   nUS   nU(       d  g X;  a  g X1   n[        U[        5      (       d  g U$ )NGET_PERMISSIONSr.   r)   )r,   r*   r+   )r   r-   r/   r)   r.   s        r"   get_permissionWebDriver.get_permissionU   sL    ,,01':m,('%&&r2   c                 H    U R                  S5        U R                  S5        g )NATTACH_DEBUGGERz	debugger;)r,   execute_script)r   s    r"   debugWebDriver.debuge   s    &'K(r2   )r   r   )NNT)__name__
__module____qualname____firstlineno____doc__r   r   r+   r   r   r0   r5   r:   __static_attributes____classcell__)r!   s   @r"   r
   r
      sd    H #'"&	4 4 	
 
 B	$B ) )r2   r
   N)selenium.common.exceptionsr   'selenium.webdriver.common.driver_finderr   #selenium.webdriver.common.webdriverr   !selenium.webdriver.safari.optionsr   +selenium.webdriver.safari.remote_connectionr   !selenium.webdriver.safari.servicer   r
    r2   r"   <module>rJ      s'   $ : @ > 5 N 5M) M)r2   