gpt4 book ai didi

python - Selenium python : Can not connect to the Service %s"% self. 路径

转载 作者:太空狗 更新时间:2023-10-30 01:13:21 28 4
gpt4 key购买 nike

我正在尝试使用 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

请指教如何解决这个问题

最佳答案

在谷歌搜索了一段时间,并尝试了各种解决方案之后。我在这里找到了对我有用的那个: https://github.com/SeleniumHQ/selenium/issues/2903#issuecomment-272112510

如评论中所述,尝试将 127.0.0.1 localhost 添加到/etc/hosts

关于python - Selenium python : Can not connect to the Service %s"% self. 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35624689/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com