
    ij"                     n    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KJr   " S S	\5      rg
)    )Optional)ChromiumOptions)ChromiumRemoteConnection)ChromiumService)DriverFinder)Command)	WebDriverc                   P  ^  \ rS rSrSr     S#S\\   S\\   S\\   S\\   S\	S	S4U 4S
 jjjr
S rS rS$S jrS$S jrS\S\S	S4S jrS\S\4U 4S jjrS	\4S jrS r\S 5       rS rS\S	\4S jrS\S	\4S jrS\S	\4S jrS\S	\4S jrS$U 4S jjrS rS  rS! rS"r U =r!$ )%ChromiumDriver   zVControls the WebDriver instance of ChromiumDriver and allows you to
drive the browser.Nbrowser_namevendor_prefixoptionsservice
keep_alivereturnc                 \  > U(       a  UO	[        5       U l        U(       a  UO	[        5       n[        U R                  U5      nUR	                  5       (       a  UR	                  5       Ul        SUl        U R                  R                  5       =(       d    UR                  5       U R                  l	        U R                  R                  5         [        U R                  R                  UUUUR                  S9n [        TU ]=  XsS9  SU l        g! [          a    U R#                  5         e f = f)a  Creates a new WebDriver instance of the ChromiumDriver. Starts the
service and then creates new WebDriver instance of ChromiumDriver.

Args:
    browser_name: Browser name used when matching capabilities.
    vendor_prefix: Company prefix to apply to vendor-specific WebDriver extension commands.
    options: This takes an instance of ChromiumOptions.
    service: Service object for handling the browser driver if you need to pass extra details.
    keep_alive: Whether to configure ChromiumRemoteConnection to use HTTP keep-alive.
N)remote_server_addrr   r   r   ignore_proxy)command_executorr   F)r   r   r   r   get_browser_pathbinary_locationbrowser_versionenv_pathget_driver_pathpathstartr   service_url_ignore_local_proxysuper__init__	Exceptionquit
_is_remote)	selfr   r   r   r   r   finderexecutor	__class__s	           RC:\des-py\RoboSAPF\venv\Lib\site-packages\selenium\webdriver\chromium\webdriver.pyr!   ChromiumDriver.__init__    s    & #*w/@$'/*;dllG4""$$&,&=&=&?G#&*G# LL113Ov7M7M7O+#||77%'! 44
	GhH
  	  	IIK	s   :D D+c                 *    U R                  SSU05      $ )z\Launches Chromium app specified by id.

Args:
    id: The id of the Chromium app to launch.
	launchAppidexecute)r%   r-   s     r)   
launch_appChromiumDriver.launch_appN   s     ||K$44    c                 *    U R                  S5      S   $ )zGets Chromium network emulation settings.

Returns:
    A dict. For example: {'latency': 4, 'download_throughput': 2, 'upload_throughput': 2}
getNetworkConditionsvaluer.   r%   s    r)   get_network_conditions%ChromiumDriver.get_network_conditionsV   s     ||23G<<r2   c                 ,    U R                  SSU05        g)a  Sets Chromium network emulation settings.

Args:
    **network_conditions: A dict with conditions specification.

Example:
    driver.set_network_conditions(
        offline=False,
        latency=5,  # additional latency (ms)
        download_throughput=500 * 1024,  # maximal throughput
        upload_throughput=500 * 1024,
    )  # maximal throughput

    Note: 'throughput' can be used to set both (for download and upload).
setNetworkConditionsnetwork_conditionsNr.   )r%   r;   s     r)   set_network_conditions%ChromiumDriver.set_network_conditions^   s      	+.BDV-WXr2   c                 &    U R                  S5        g)z+Resets Chromium network emulation settings.deleteNetworkConditionsNr.   r6   s    r)   delete_network_conditions(ChromiumDriver.delete_network_conditionsp   s    ./r2   namer5   c                 2    U R                  SSU0US.5        g)zSets Applicable Permission.

Args:
    name: The item to set the permission on.
    value: The value to set on the item

Example:
    driver.set_permissions("clipboard-read", "denied")
setPermissionsrB   )
descriptorstateNr.   )r%   rB   r5   s      r)   set_permissionsChromiumDriver.set_permissionst   s     	%vtnu'UVr2   cmdcmd_argsc                 "   > [         TU ]  X5      $ )aK  Execute Chrome Devtools Protocol command and get returned result The
command and command args should follow chrome devtools protocol
domains/commands, refer to link
https://chromedevtools.github.io/devtools-protocol/

Args:
    cmd: A str, command name
    cmd_args: A dict, command args. empty dict {} if there is no command args

Example:
    driver.execute_cdp_cmd('Network.getResponseBody', {'requestId': requestId})

Returns:
    A dict, empty dict {} if there is no result to return.
    For example to getResponseBody:
    {'base64Encoded': False, 'body': 'response body string'}
)r    execute_cdp_cmd)r%   rI   rJ   r(   s      r)   rL   ChromiumDriver.execute_cdp_cmd   s    $ w&s55r2   c                 *    U R                  S5      S   $ )z2
Returns:
    A list of sinks available for Cast.
getSinksr5   r.   r6   s    r)   	get_sinksChromiumDriver.get_sinks   s    
 ||J'00r2   c                 *    U R                  S5      S   $ )zJ
Returns:
    An error message when there is any issue in a Cast session.
getIssueMessager5   r.   r6   s    r)   get_issue_message ChromiumDriver.get_issue_message   s    
 ||-.w77r2   c                 F    U R                  [        R                  5      S   $ )zPGets a list of the available log types.

Example:
--------
>>> driver.log_types
r5   )r/   r   GET_AVAILABLE_LOG_TYPESr6   s    r)   	log_typesChromiumDriver.log_types   s     ||G;;<WEEr2   c                 L    U R                  [        R                  SU05      S   $ )zGets the log for a given log type.

Args:
    log_type: Type of log that which will be returned

Example:
    >>> driver.get_log("browser")
    >>> driver.get_log("driver")
    >>> driver.get_log("client")
    >>> driver.get_log("server")
typer5   )r/   r   GET_LOG)r%   log_types     r)   get_logChromiumDriver.get_log   s#     ||GOOfh-?@IIr2   	sink_namec                 *    U R                  SSU05      $ )zSets a specific sink, using its name, as a Cast session receiver
target.

Args:
    sink_name: Name of the sink to use as the target.
setSinkToUsesinkNamer.   r%   r`   s     r)   set_sink_to_useChromiumDriver.set_sink_to_use   s     ||NZ,CDDr2   c                 *    U R                  SSU05      $ )zStarts a desktop mirroring session on a specific receiver target.

Args:
    sink_name: Name of the sink to use as the target.
startDesktopMirroringrc   r.   rd   s     r)   start_desktop_mirroring&ChromiumDriver.start_desktop_mirroring   s     ||3j)5LMMr2   c                 *    U R                  SSU05      $ )z{Starts a tab mirroring session on a specific receiver target.

Args:
    sink_name: Name of the sink to use as the target.
startTabMirroringrc   r.   rd   s     r)   start_tab_mirroring"ChromiumDriver.start_tab_mirroring   s     ||/*i1HIIr2   c                 *    U R                  SSU05      $ )zStops the existing Cast session on a specific receiver target.

Args:
    sink_name: Name of the sink to stop the Cast session.
stopCastingrc   r.   rd   s     r)   stop_castingChromiumDriver.stop_casting   s     ||MJ	+BCCr2   c                    >  [         TU ]  5         U R                  R	                  5         g! [         a     N'f = f! U R                  R	                  5         f = f)z@Closes the browser and shuts down the ChromiumDriver executable.N)r    r#   r"   r   stop)r%   r(   s    r)   r#   ChromiumDriver.quit   sJ    	 GLN
 LL	  		 LLs   , 
9< 9< Ac                     [         e)zCDownload file functionality is not implemented for Chromium driver.NotImplementedErrorr%   argskwargss      r)   download_fileChromiumDriver.download_file       !!r2   c                     [         e)zLGet downloadable files functionality is not implemented for Chromium driver.rw   ry   s      r)   get_downloadable_files%ChromiumDriver.get_downloadable_files   r~   r2   c                     [         e)zODelete downloadable files functionality is not implemented for Chromium driver.rw   ry   s      r)   delete_downloadable_files(ChromiumDriver.delete_downloadable_files   r~   r2   )r$   r   )NNNNT)r   N)"__name__
__module____qualname____firstlineno____doc__r   strr   r   boolr!   r0   r7   r<   r@   rG   dictrL   listrP   rT   propertyrX   r^   re   ri   rm   rq   r#   r|   r   r   __static_attributes____classcell__)r(   s   @r)   r   r      sT   
 '+'+-1-1, sm,   },  /*	, 
 /*,  ,  
,  , \5=Y$0
WC 
W 
W 
W63 6$ 6(14 18 F FJE E EN N NJS JT JDc Dd D """ "r2   r   N)typingr   #selenium.webdriver.chromium.optionsr   -selenium.webdriver.chromium.remote_connectionr   #selenium.webdriver.chromium.servicer   'selenium.webdriver.common.driver_finderr   !selenium.webdriver.remote.commandr   #selenium.webdriver.remote.webdriverr	   RemoteWebDriverr    r2   r)   <module>r      s*   $  ? R ? @ 5 LS"_ S"r2   