Selenium Webdriver Issue w / Chrome in Python:回溯错误且无法确定载入状态

时间:2018-08-23 21:50:57

标签: python selenium-webdriver

尝试运行从this github project找到的代码

我一直遇到以下错误:

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)

谢谢! &让我知道我是否可以提供任何帮助。

1 个答案:

答案 0 :(得分:0)

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

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版本,即版本68