繁体   English   中英

Python 中带有 Chrome 的 Selenium Webdriver 问题:回溯错误和无法确定加载状态

[英]Selenium Webdriver Issue w/ Chrome in Python: Traceback Errors & Can't Determine Loading Status

试图运行从这个 github 项目中找到的代码

我不断遇到以下错误:

DevTools listening on ws://127.0.0.1:12522/devtools/browser/17d610a1-0dc4-45da-8766-b1592dd689ab
Logging into Linkedin account ...
Traceback (most recent call last):
  File ".\LinkedinEasyApply.py", line 244, in <module>
    login(driver, username, password)
  File ".\LinkedinEasyApply.py", line 49, in login
    driver.get("https://www.linkedin.com/")
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 332, in get
    self.execute(Command.GET, {'url': url})
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
  (Session info: chrome=68.0.3440.106)
  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.17134 x86_64)

我使用的是 Windows 64 .. 我不确定 Selenium 是否找不到路径或问题是什么。 目前,程序会在错误发生前打开 Linkedin。 我尝试了许多不同的解决方案,包括不同版本的 chrome,以及 Selenium 和 Chrome 的不同路径。

如果我使用 Chrome 版本 2.41(最新),我会收到此消息...

Traceback (most recent call last):
  File ".\LinkedinEasyApply.py", line 246, in <module>
    searchJobs(driver)
  File ".\LinkedinEasyApply.py", line 92, in searchJobs
    search_button.click()
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Seane\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Element <button class="jobs-search-box__submit-button button-secondary-large-inverse" data-ember-action="" data-ember-action-1764="1764">...</button> is not clickable at point (971, 20). Other element would receive the click: <a id="ember1706" data-control-name="premium_nav_upsell_text_click" title="Free Upgrade to Premium" href="/premium/products/?destRedirectURL=https%3A%2F%2Fwww.linkedin.com%2Fjobs%2F%3FshowPremiumWelcomeBanner%3Dtrue&amp;upsellOrderOrigin=premium_nav_upsell_text" class="link-without-visited-state nav-item__spotlight-upsell premium-upsell-link--long ember-view">...</a>
  (Session info: chrome=68.0.3440.106)
  (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)

谢谢! &如果我能帮上忙,请告诉我。

更新- 您正在尝试单击一个不可见的元素或由于按钮上的覆盖而单击另一个跨度,鉴于此处的错误 -

Other element would receive the click: <a id="ember1706" data-control-name="premium_nav_upsell_text_click" title="Free Upgrade to Premium" href="/premium/products/?destRedirectURL=https%3A%2F%2Fwww.linkedin.com%2Fjobs%2F%3FshowPremiumWelcomeBanner%3Dtrue&amp;upsellOrderOrigin=premium_nav_upsell_text" class="link-without-visited-state nav-item__spotlight-upsell premium-upsell-link--long ember-view">...</a>

原始答案将您的 chrome 驱动程序(当前为 2.29)从这里更新到最新版本 2.41 - https://sites.google.com/a/chromium.org/chromedriver/downloads

您当前的驱动程序不支持 Chrome 版本,即 ver 68

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM