
    8ht                     n    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 ddlmZ  G d	 d
e	      Zy)    N)DesiredCapabilities)DriverFinder)	WebDriver   )Options)DEFAULT_EXECUTABLE_PATH)Servicec                   L     e Zd ZdZeddej                  df fd	Z fdZ xZ	S )r   zAControls the WPEWebKitDriver and allows you to drive the browser.r   Nc                 v   |r$|j                         }|j                  |       |}n
t               }t        |||      | _        t        j                  | j                  |      | j                  _        | j                  j                          t        | )  | j                  j                  |       d| _        y)aB  Creates a new instance of the WPEWebKit driver.

        Starts the service and then creates new instance of WPEWebKit 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 WPEWebKitOptions
         - desired_capabilities : Dictionary object with desired capabilities
         - service_log_path : Path to write service stdout and stderr output.
        )portlog_path)command_executordesired_capabilitiesFN)to_capabilitiesupdater   r	   servicer   get_pathpathstartsuper__init__service_url
_is_remote)selfexecutable_pathr   optionsr   service_log_pathcapabilities	__class__s          }/home/stella.sw7ft.com/public_html/site_rebuilder/venv/lib/python3.12/site-packages/selenium/webdriver/wpewebkit/webdriver.pyr   zWebDriver.__init__    s    & "224L 45#/ iGTDTU(11$,,H$,,*B*BYmn    c                     	 t         |           | j                  j                          y# t        j                  $ r Y 0w xY w# | j                  j                          w xY w)z{Closes the browser and shuts down the WPEWebKitDriver executable
        that is started when starting the WPEWebKitDriver.N)r   quithttp_clientBadStatusLiner   stop)r   r   s    r    r#   zWebDriver.quitA   sP    	 GLN LL (( 		 LLs    , AA AA A!)
__name__
__module____qualname____doc__r   r   	WPEWEBKITr   r#   __classcell__)r   s   @r    r   r      s-    K 00:: B   r!   r   )http.clientclientr$   .selenium.webdriver.common.desired_capabilitiesr   'selenium.webdriver.common.driver_finderr   #selenium.webdriver.remote.webdriverr   RemoteWebDriverr   r   r   r   r	    r!   r    <module>r4      s(   $ " N @ L  , ,  , r!   