我正在尝试使用python脚本运行selenium测试,但是在执行测试时我收到以下错误:
Traceback (most recent call last):
File "/var/www/html/selenium-scripts/example.py", line 13, in <module>
driver = webdriver.Chrome()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__self.service.start()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 88, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service chromedriver
Run Code Online (Sandbox Code Playgroud)
请告知如何解决这个问题
小智 7
经过一段时间的谷歌搜索,并尝试了各种解决方案。我在这里找到了对我有用的一个: https://github.com/SeleniumHQ/selenium/issues/2903#issuecomment-272112510
正如该评论中提到的,尝试添加127.0.0.1 localhost到 /etc/hosts
| 归档时间: |
|
| 查看次数: |
4876 次 |
| 最近记录: |