这是html代码:
< input class="form-control input-lg input auto-complete" id="ymMsgInput" type="text" placeholder="Type your message ..." autocomplete="off" >
代码:
i = s.find_element_by_id("ymMsgInput");
Python - Selenium Chrome 网络驱动程序错误:
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
i = s.find_element_by_id("ymMsgInput");
File "C:\Users\vishn\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 351, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File "C:\Users\vishn\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 955, in find_element
'value': value})['value']
File "C:\Users\vishn\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "C:\Users\vishn\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 10.0.16299 x86_64)
原文由 Guru Vishnu Vardhan Reddy 发布,翻译遵循 CC BY-SA 4.0 许可协议
错误说明了一切:
如果用户使用的二进制文件之间存在 版本兼容性,则会出现此错误,但绝对不是您的情况:
chromedriver=2.36 的发行说明清楚地提到:
但是,自从最新的 Chromedriver 2.36 Selenium 用户发布以来,它一直面临着问题。这是线程之一:
根本原因与提交有关:
因此,一些可能的解决方案是:
使用 ChromeOptions 类来最大化浏览器。
删除 选项
disable-infobars
一个例子 :
如果您的问题仍然存在,请考虑以下事项:
Test
。