<i id='Ue4HR'><tr id='Ue4HR'><dt id='Ue4HR'><q id='Ue4HR'><span id='Ue4HR'><b id='Ue4HR'><form id='Ue4HR'><ins id='Ue4HR'></ins><ul id='Ue4HR'></ul><sub id='Ue4HR'></sub></form><legend id='Ue4HR'></legend><bdo id='Ue4HR'><pre id='Ue4HR'><center id='Ue4HR'></center></pre></bdo></b><th id='Ue4HR'></th></span></q></dt></tr></i><div id='Ue4HR'><tfoot id='Ue4HR'></tfoot><dl id='Ue4HR'><fieldset id='Ue4HR'></fieldset></dl></div>
    • <bdo id='Ue4HR'></bdo><ul id='Ue4HR'></ul>
    <legend id='Ue4HR'><style id='Ue4HR'><dir id='Ue4HR'><q id='Ue4HR'></q></dir></style></legend>

    1. <small id='Ue4HR'></small><noframes id='Ue4HR'>

    2. <tfoot id='Ue4HR'></tfoot>

      1. selenium.common.exceptions.TimeoutException 同时通过 expe

        时间:2023-10-08
          <bdo id='VpUXl'></bdo><ul id='VpUXl'></ul>
          <i id='VpUXl'><tr id='VpUXl'><dt id='VpUXl'><q id='VpUXl'><span id='VpUXl'><b id='VpUXl'><form id='VpUXl'><ins id='VpUXl'></ins><ul id='VpUXl'></ul><sub id='VpUXl'></sub></form><legend id='VpUXl'></legend><bdo id='VpUXl'><pre id='VpUXl'><center id='VpUXl'></center></pre></bdo></b><th id='VpUXl'></th></span></q></dt></tr></i><div id='VpUXl'><tfoot id='VpUXl'></tfoot><dl id='VpUXl'><fieldset id='VpUXl'></fieldset></dl></div>

              <legend id='VpUXl'><style id='VpUXl'><dir id='VpUXl'><q id='VpUXl'></q></dir></style></legend>

                  <tbody id='VpUXl'></tbody>
              1. <small id='VpUXl'></small><noframes id='VpUXl'>

                  <tfoot id='VpUXl'></tfoot>
                  本文介绍了selenium.common.exceptions.TimeoutException 同时通过 expected_conditions 在元素上调用 .click()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  使用 python、chromedriver 和 Windows.我已经编写了几个月的脚本,它定期使用 .click() 函数,几天前它停止在网站上的任何地方工作.我一直在尝试通过 id、xpath 等定位元素……甚至通过 send_keys(Keys.ENTER) 单击它,但没有成功.我只是想点击登录图标,但没有任何反应.似乎找到了元素并单击它,但没有任何反应.这是

                  -之后应该会出现

                  解决方案

                  根据您分享的 url 点击链接,文本为 Regístrate o inicia sesión您可以使用以下任一

                  Using python, chromedriver and Windows. I've working on a script for some months which uses .click() function regularly, few days ago it stopped working anywhere on the site. I've been trying to locate the element by id, xpath, etc... or even click it by send_keys(Keys.ENTER) with no success. I'm just trying to click the login icon but nothing happens. Seems to find the element and even click it, but nothing happens. This is the site and here the code:

                  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()
                  

                  a part from not working this is what I get from the terminal:

                  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:UserszaicoAppDataLocalProgramsPythonPython36libsite-packages
                  seleniumwebdriversupportwait.py", line 80, in until
                      raise TimeoutException(message, screen, stacktrace)
                  selenium.common.exceptions.TimeoutException: Message:
                  

                  and this is what should happen on the browser:

                  -first click on the icon

                  -and after this should appear

                  解决方案

                  As per the url you have shared to click on the link with text as Regístrate o inicia sesión you can take help of either of the following Locator Strategies:

                  • LINK_TEXT
                  • PARTIAL_LINK_TEXT
                  • CSS_SELECTOR
                  • XPATH

                  Here is the sample code using PARTIAL_LINK_TEXT:

                  # -*- 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:UtilityBrowserDriverschromedriver.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()
                  

                  Browser Snapshot:

                  这篇关于selenium.common.exceptions.TimeoutException 同时通过 expected_conditions 在元素上调用 .click()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何通过 Selenium 和 Python 以无头模式启动 Chrome 下一篇:使用 python 和 selenium 进行自动化 Google 登录显示“

                  相关文章

                  最新文章

                  <tfoot id='NZoXF'></tfoot>
                  • <bdo id='NZoXF'></bdo><ul id='NZoXF'></ul>
                  <legend id='NZoXF'><style id='NZoXF'><dir id='NZoXF'><q id='NZoXF'></q></dir></style></legend>

                  <small id='NZoXF'></small><noframes id='NZoXF'>

                      <i id='NZoXF'><tr id='NZoXF'><dt id='NZoXF'><q id='NZoXF'><span id='NZoXF'><b id='NZoXF'><form id='NZoXF'><ins id='NZoXF'></ins><ul id='NZoXF'></ul><sub id='NZoXF'></sub></form><legend id='NZoXF'></legend><bdo id='NZoXF'><pre id='NZoXF'><center id='NZoXF'></center></pre></bdo></b><th id='NZoXF'></th></span></q></dt></tr></i><div id='NZoXF'><tfoot id='NZoXF'></tfoot><dl id='NZoXF'><fieldset id='NZoXF'></fieldset></dl></div>