
    vKg%                         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KJr  S	S
KJr   " S S5      rg)    )Optional)Union)NoSuchElementException)NoSuchFrameException)NoSuchWindowException)Alert)By)
WebElement   )Commandc                       \ rS rSrSS jr\S\4S j5       r\S\4S j5       r	SS jr
S\\\\4   SS4S	 jrSS
\\   SS4S jjrSS jrS\SS4S jrS\SS4S jrSrg)SwitchTo   returnNc                 8    SS K nUR                  U5      U l        g )Nr   )weakrefproxy_driver)selfdriverr   s      c/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/selenium/webdriver/remote/switch_to.py__init__SwitchTo.__init__    s    }}V,    c                 Z    U R                   R                  [        R                  5      S   $ )zReturns the element with focus, or BODY if nothing has focus.

:Usage:
    ::

        element = driver.switch_to.active_element
value)r   executer   W3C_GET_ACTIVE_ELEMENTr   s    r   active_elementSwitchTo.active_element%   s$     ||##G$B$BCGLLr   c                 H    [        U R                  5      nUR                  nU$ )z`Switches focus to an alert on the page.

:Usage:
    ::

        alert = driver.switch_to.alert
)r   r   text)r   alert_s      r   r$   SwitchTo.alert0   s      dll#JJr   c                 \    U R                   R                  [        R                  SS05        g)z_Switch focus to the default frame.

:Usage:
    ::

        driver.switch_to.default_content()
idN)r   r   r   SWITCH_TO_FRAMEr   s    r   default_contentSwitchTo.default_content=   s"     	W44tTlCr   frame_referencec                    [        U[        5      (       a+   U R                  R                  [        R
                  U5      nU R                  R                  [        R                  SU05        g! [         aL     U R                  R                  [        R                  U5      n Nd! [         a  n[        U5      UeSnAff = ff = f)a  Switches focus to the specified frame, by index, name, or
webelement.

:Args:
 - frame_reference: The name of the window to switch to, an integer representing the index,
                    or a webelement that is an (i)frame to switch to.

:Usage:
    ::

        driver.switch_to.frame('frame_name')
        driver.switch_to.frame(1)
        driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0])
Nr(   )
isinstancestrr   find_elementr	   IDr   NAMEr   r   r   r)   )r   r,   excs      r   frameSwitchTo.frameG   s     os++I"&,,";";BEE?"S 	W44t_6MN * II&*ll&?&?&YO- I.?SHIIs)   *A. .
C9*B%%
C /B;;C  C	type_hintc                     U R                   R                  [        R                  SU05      S   nU R	                  US   5        g)zSwitches to a new top-level browsing context.

The type hint can be one of "tab" or "window". If not specified the
browser will automatically select it.

:Usage:
    ::

        driver.switch_to.new_window('tab')
typer   handleN)r   r   r   
NEW_WINDOW_w3c_window)r   r6   r   s      r   
new_windowSwitchTo.new_windowa   s<     $$W%7%7&)9LMgVx)r   c                 V    U R                   R                  [        R                  5        g)zSwitches focus to the parent context. If the current context is the
top level browsing context, the context remains unchanged.

:Usage:
    ::

        driver.switch_to.parent_frame()
N)r   r   r   SWITCH_TO_PARENT_FRAMEr   s    r   parent_frameSwitchTo.parent_frameo   s     	W;;<r   window_namec                 &    U R                  U5        g)zSwitches focus to the specified window.

:Args:
 - window_name: The name or window handle of the window to switch to.

:Usage:
    ::

        driver.switch_to.window('main')
N)r;   )r   rB   s     r   windowSwitchTo.windowz   s     	%r   c                   ^  U 4S jn U" U5        g ! [          aj    T R                  R                  nT R                  R                  nU H.  nU" U5        T R                  R	                  S5      nX:X  d  M-     g    U" U5        e f = f)Nc                 ^   > TR                   R                  [        R                  SU 05        g )Nr9   )r   r   r   SWITCH_TO_WINDOW)hr   s    r   send_handle)SwitchTo._w3c_window.<locals>.send_handle   s!    LL  !9!9Ha=Ir   zreturn window.name)r   r   current_window_handlewindow_handlesexecute_script)r   rB   rJ   original_handlehandlesr9   current_names   `      r   r;   SwitchTo._w3c_window   s    	J	$$ 
	"ll@@Oll11G!F##||::;OP.	 "
 (
	s    A!B7B:B)r   )r   N)N)__name__
__module____qualname____firstlineno__r   propertyr
   r    r   r$   r*   r   r/   intr4   r   r<   r@   rD   r;   __static_attributes__ r   r   r   r      s    -
 M
 M M 
u 
 
DOU3Z+?%@ OT O4*HSM *T *	=&# &$ &s t r   r   N)typingr   r   selenium.common.exceptionsr   r   r   selenium.webdriver.common.alertr   selenium.webdriver.common.byr	   $selenium.webdriver.remote.webelementr
   commandr   r   rZ   r   r   <module>ra      s.   $   = ; < 1 + ; y yr   