Python selenium.common.exceptions.TimeoutException在通过预期的\u条件调用元素时单击()

Python selenium.common.exceptions.TimeoutException在通过预期的\u条件调用元素时单击(),python,google-chrome,selenium,selenium-webdriver,selenium-chromedriver,Python,Google Chrome,Selenium,Selenium Webdriver,Selenium Chromedriver,使用python、chromedriver和Windows。 几个月来,我一直在编写一个定期使用.click()函数的脚本,几天前它在网站的任何地方都停止了工作。我一直在尝试通过id、xpath等来定位元素。。。甚至通过send_keys(key.ENTER)单击它,但没有成功。我只是想点击登录图标,但什么也没发生。似乎找到了元素,甚至单击了它,但什么也没发生。以下是代码: browser = webdriver.Chrome(chrome_options=options, executable

使用python、chromedriver和Windows。 几个月来,我一直在编写一个定期使用.click()函数的脚本,几天前它在网站的任何地方都停止了工作。我一直在尝试通过id、xpath等来定位元素。。。甚至通过
send_keys(key.ENTER)
单击它,但没有成功。我只是想点击登录图标,但什么也没发生。似乎找到了元素,甚至单击了它,但什么也没发生。以下是代码:

browser = webdriver.Chrome(chrome_options=options, executable_path=r'chromedriver.exe')

browser.get(('https://es.wallapop.com/'))

signInButton = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'js-show-login-modal')))
signInButton.click()

signInButton = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.ID, 'btn-go-login-form')))
signInButton.click()
不工作的一部分这是我从终端得到的:

Traceback (most recent call last):
  File "wallapop_delete.py", line 55, in <module>
    signInButton = WebDriverWait(browser, 5).until(EC.element_to_be_clickable((B
y.ID, 'btn-go-login-form')))
  File "C:\Users\zaico\AppData\Local\Programs\Python\Python36\lib\site-packages\
selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
回溯(最近一次呼叫最后一次):
文件“wallapop_delete.py”,第55行,在
signInButton=WebDriverWait(浏览器,5)。直到(EC.element)可点击((B
y、 ID,'btn go登录表单'))
文件“C:\Users\zaico\AppData\Local\Programs\Python\36\lib\site包\
selenium\webdriver\support\wait.py”,第80行,直到
引发TimeoutException(消息、屏幕、堆栈跟踪)
selenium.common.Exception.TimeoutException:消息:
这就是浏览器上应该发生的事情:

-首先点击图标

-在这之后应该出现

根据您共享的url,点击链接,文本为Regístrate o inicia sesión,您可以通过以下任一方式获得帮助:

  • LINK\u文本
  • PARTIAL\u LINK\u TEXT
  • CSS\u选择器
  • XPATH
下面是使用
PARTIAL\u LINK文本

# -*- coding: UTF-8 -*-
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

options = webdriver.ChromeOptions() 
options.add_argument("start-maximized")
options.add_argument('disable-infobars')
browser=webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
browser.get("https://es.wallapop.com/")
WebDriverWait(browser, 5).until(EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, 'strate o inicia sesi'))).click()
浏览器快照:


您是否检查了(浏览器)错误?您的chrome和chrome驱动程序是什么version@Zaico-我不明白你的意思,请同时添加chrome浏览器和chrome浏览器的版本号driver@Zaico是的,我看到过这些屏幕,因为您的代码与我的旧chromedriver(2.36?)一起工作,并进行了尝试/例外。我刚刚将chromedriver升级到最新版本(2.40?),您的代码可以正常工作,无需任何修改。你试过升级你的chromedriver吗?@Zaico-请将你的chromedriver升级到2.40谢谢。问题是,一旦我登录,单击的元素就不再工作了。例如,如果要单击WebDriverWait(浏览器,5)。直到(EC.element可单击((By.XPATH,/html/body/tsl root/tsl list/div/div/div/tsl目录项[1]/div/div[2]/span[2]/span/button[4])。单击()