Open Lyfhael opened 1 year ago
Apparently a Timeout exception is triggered, try making the timeout a bit longer by modifying The second arg in the wait function, if that doesn't work try using XPATH instead of CSS_SELECTOR!
Also one more thing to make your coding way more efficient and clean, is to clean up the imports, remove double imports such as:
from selenium import webdriver
I would also recommend to have them in a sort of pyramid from short name imports to long name imports, or have them separated, just to improve workflow!
import time
from selenium import webdriver
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
undetected-chromedriver version : 3.5.3 selenium version : 4.11.2 os: windows 11
Hello, I am trying to make a very basic script that access a url and click on the login button. I'm not being blocked, by using driver.save_screenshot('nowsecure2.png') I can see that the page is displayed and the login button visible.
However when the script reaches this line : login_button = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href='//discord.com/login']")))
It throws an error :
I tried without undetected_chromedriver and it works, but I want to use undetected_chromedriver.
Here is the full code :
Thank you