【发布时间】:2019-12-15 15:57:41
【问题描述】:
我遇到了一个错误
E
======================================================================
ERROR: test_01Login (__main__.LoginTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:/Users/amal/AppData/Local/Continuum/anaconda3/Lib/site-packages/Sucess/Test/Login_sj.py", line 29, in test_01Login
driver.get("https://google.com")
File "C:\Users\amal\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "C:\Users\amal\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\amal\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: disconnected: received Inspector.detached event
(Session info: chrome=76.0.3809.100)
----------------------------------------------------------------------
Ran 1 test in 8.615s
FAILED (errors=1)
在尝试使用 python 3.7 和 selenium 3.141.0 自动化网页时
这是在 windows 10 中。我的 java 版本是 jdk-12.0.2,chrome 驱动程序是 ChromeDriver 76.0.3809.68
driver = webdriver.Chrome()
driver.get("https://google.com")
我是自动化新手,通过反复试验学习,并为任何错误找借口,因为我刚刚创建了这个帐户并第一次尝试在任何论坛上发帖。我尝试重新安装 Java、Chrome 并尝试了多个版本的 chromedriver。任何帮助将不胜感激。
【问题讨论】:
-
始终将完整的错误消息(不是评论)作为文本(不是屏幕截图)。还有其他有用的信息。
-
是的先生,已经尝试解决这个问题大约 4-5 天,我看到每个人都建议更新 chrome webdriver 或 java 版本。我看到它可以在另一台机器上正常工作,不知道还有什么可以比较的。我现在在初始评论中添加了完整的错误,因为我无法在此处粘贴。
-
有时 chromedriver 需要特定版本的 chrome 浏览器。也许您的错误应该询问 chromedriver 的作者或 chromdriver 的论坛。
-
第 29 行有错误。第 1-28 行还有什么?
-
实际上所有其他人都已被注释掉,只有我在调用上面的两行。我的 chrome 驱动程序是 76.0.3809.68 版本,chrome 浏览器是 76.0.3809.100。我也在 chrome 帮助论坛中发布了这个查询。谢谢@furas
标签: python selenium google-chrome selenium-chromedriver web-inspector