
    Fth@                     j    d dl mZ d dlmZ d dlmZ ddlm	Z	 ddl
mZ ddl
mZ  G d d	e          ZdS )
    N)DriverFinder)	WebDriver   )Options)DEFAULT_EXECUTABLE_PATH)Servicec                   :     e Zd ZdZedddddf fd	Z fdZ xZS )r   zAControls the WebKitGTKDriver and allows you to drive the browser.r   NFc                    |s%t                      }|s|                                }n-|                                }|r|                    |           |}t          |||          | _        t          j        | j        |          | j        _        | j                                         t                      
                    | j        j        ||           d| _        dS )a  Creates a new instance of the WebKitGTK driver.

        Starts the service and then creates new instance of WebKitGTK Driver.

        :Args:
         - executable_path : path to the executable. If the default is used it assumes the executable is in the $PATH.
         - port : port you would like the service to run, if left as 0, a free port will be found.
         - options : an instance of WebKitGTKOptions
         - desired_capabilities : Dictionary object with desired capabilities
         - service_log_path : Path to write service stdout and stderr output.
         - keep_alive : Whether to configure RemoteConnection to use HTTP keep-alive.
        )portlog_path)command_executordesired_capabilities
keep_aliveFN)r   to_capabilitiesupdater   servicer   get_pathpathstartsuper__init__service_url
_is_remote)	selfexecutable_pathr   optionsr   service_log_pathr   capabilities	__class__s	           z/var/www/html/mycamper/aliexpress-site/backend/venv/lib/python3.11/site-packages/selenium/webdriver/webkitgtk/webdriver.pyr   zWebDriver.__init__   s    *  	0iiG' A'.'>'>'@'@$"2244L# :##$8999#/ TDTUUU(1$,HH!\5L`mw 	 	
 	
 	
      c                     	 t                                                       n# t          j        $ r Y nw xY w| j                                         dS # | j                                         w xY w)z{Closes the browser and shuts down the WebKitGTKDriver executable
        that is started when starting the WebKitGTKDriver.N)r   quithttp_clientBadStatusLiner   stop)r   r   s    r    r#   zWebDriver.quitG   st    	 GGLLNNNN( 	 	 	D	 LDLs!    $ A 6A 6A A/)__name__
__module____qualname____doc__r   r   r#   __classcell__)r   s   @r    r   r      sq        KK 0!&  &  &  &  &  & P                 r!   r   )http.clientclientr$   'selenium.webdriver.common.driver_finderr   #selenium.webdriver.remote.webdriverr   RemoteWebDriverr   r   r   r   r    r!   r    <module>r2      s   $ " ! ! ! ! ! @ @ @ @ @ @ L L L L L L       , , , , , ,      3  3  3  3  3  3  3  3  3  3 r!   