When I enter the google website, this small login window appears:
I'm trying to dismiss it using selenium with pyhton
Here is the code i am using:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.get('https://www.google.com.br')
driver.maximize_window()
# wait
wait = WebDriverWait(driver, 10)
not_now_button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="yDmH0d"]/c-wiz/div/div/c-wiz/div/div/div/div[2]/div[2]/button')))
# click
not_now_button.click()
I get the error below:
Traceback (most recent call last):
File "C:\Users\sec-info\Desktop\python\googlr.py", line 13, in <module>
not_now_button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="yDmH0d"]/c-wiz/div/div/c-wiz/div/div/div/div[2]/div[2]/button')))
File "C:\Users\sec-info\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\support\wait.py", line 95, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
Backtrace:
(No symbol) [0x0037DCE3]
(No symbol) [0x003139D1]
(No symbol) [0x00224DA8]
(No symbol) [0x0025019F]
(No symbol) [0x002503AB]
(No symbol) [0x0027EE62]
(No symbol) [0x0026AF14]
(No symbol) [0x0027D57C]
(No symbol) [0x0026ACC6]
(No symbol) [0x00246F68]
(No symbol) [0x002480CD]
GetHandleVerifier [0x005F3832+2506274]
GetHandleVerifier [0x00629794+2727300]
GetHandleVerifier [0x0062E36C+2746716]
GetHandleVerifier [0x00426690+617600]
(No symbol) [0x0031C712]
(No symbol) [0x00321FF8]
(No symbol) [0x003220DB]
(No symbol) [0x0032C63B]
BaseThreadInitThunk [0x76CBFA29+25]
RtlGetAppContainerNamedObjectPath [0x77E57A9E+286]
RtlGetAppContainerNamedObjectPath [0x77E57A6E+238]
Python: 3.11.2 Selenium: 4.8.2 Chromedriver: 111.0.5563.64
