You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
Traceback (most recent call last):
File"C:\Users\xxx\Documents\Programs\xxx\xxx\main.py", line 35, in <module>
create_discord_account("[email protected]", "ahcujefe", "iojffjeeufj")
File"C:\Users\xxx\Documents\Programs\xxx\xxx\main.py", line 21, in create_discord_account
login_button = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href='//discord.com/login']")))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"C:\Users\xxx\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:Exception ignored in:<function Chrome.__del__ at 0x000001DEB946B740>Traceback (most recent call last):
File"C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver\__init__.py", line 843, in __del__
File"C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_chromedriver\__init__.py", line 798, in quit
OSError: [WinError6] Descripteur non valide
I tried without undetected_chromedriver and it works, but I want to use undetected_chromedriver.
Here is the full code :
fromseleniumimportwebdriverfromselenium.webdriver.common.keysimportKeysfromselenium.webdriver.common.byimportByfromselenium.webdriver.support.uiimportWebDriverWaitfromselenium.webdriver.supportimportexpected_conditionsasECfromselenium.common.exceptionsimportTimeoutExceptionfromselenium.webdriver.chrome.optionsimportOptionsfromseleniumimportwebdriverimportundetected_chromedriverasucimporttimedefcreate_discord_account(email, username, password):
# create a new browser instancedriver=uc.Chrome(headless=True, use_subprocess=False)
# navigate to the Discord registration pagedriver.get("https://discord.com/")
# driver = webdriver.Chrome()wait=WebDriverWait(driver, 20)
login_button=wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a[href='//discord.com/login']")))
login_button.click()
driver.save_screenshot('nowsecure2.png')
register_button=wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "smallRegisterLink-1qEJhz")))
# click the register buttonregister_button.click()
driver.save_screenshot('nowsecure3.png')
time.sleep(10)
# close the browserdriver.quit()
if__name__=="__main__":
create_discord_account("[email protected]", "ahcujefe", "iojffjeeufj")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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
Beta Was this translation helpful? Give feedback.
All reactions