
    vKg                     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)	WebDriver   )DriverFinder   )Options)SafariRemoteConnection)Servicec                   d   ^  \ rS rSrSr   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$ )r      z>Controls the SafariDriver and allows you to drive the browser.Noptionsservicereturnc                 (  > U(       a  UO	[        5       U l        U(       a  UO	[        5       nU R                  R                  5       =(       d$    [	        U R                  U5      R                  5       U R                  l        U R                  R                  (       d  U R                  R                  5         [        U R                  R                  UUR                  S9n [        TU ]5  XBS9  SU l        g! [         a    U R                  5         e f = f)aZ  Creates a new Safari driver instance and launches or finds a running
safaridriver service.

:Args:
 - keep_alive - Whether to configure SafariRemoteConnection to use
     HTTP keep-alive. Defaults to True.
 - options - Instance of ``options.Options``.
 - service - Service object for handling the browser driver if you need to pass extra details
)remote_server_addr
keep_aliveignore_proxy)command_executorr   FN)r
   r   r   env_pathr   get_driver_pathpathreuse_servicestartr	   service_url_ignore_local_proxysuper__init__	Exceptionquit
_is_remote)selfr   r   r   executor	__class__s        c/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/selenium/webdriver/safari/webdriver.pyr   WebDriver.__init__   s     #*wwy$'') LL113l|DLLRY7Z7j7j7l||))LL )#||77! 44
	GhH
  	  	IIK	s    C5 5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.quitC   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_permissionR   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_PERMISSIONSr0   r+   )r.   r,   r-   )r!   r/   r1   r+   r0   s        r$   get_permissionWebDriver.get_permissionZ   sL    ,,01':m,('%&&r4   c                 H    U R                  S5        U R                  S5        g )NATTACH_DEBUGGERz	debugger;)r.   execute_script)r!   s    r$   debugWebDriver.debugj   s    &'K(r4   )r    r   )TNN)__name__
__module____qualname____firstlineno____doc__r   r
   r   r   r2   r7   r<   __static_attributes____classcell__)r#   s   @r$   r   r      sT    H 	#  #  	# 
 
#  # J	$B ) )r4   r   N)selenium.common.exceptionsr   #selenium.webdriver.remote.webdriverr   RemoteWebDrivercommon.driver_finderr   r   r   remote_connectionr	   r   r
    r4   r$   <module>rK      s'   $ : L /  5 Q) Q)r4   