mac selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service chromedri

解决办法  ping localhost

1. 确保你的webdriver(如safaridriver、phantomjs等)已经下载并解压存放在你的环境变量目录下 

  我的存放目录:/usr/bin/chromedriver

  检查方式:terminal中输入which chromedriver

 2.如果仍然不行,请尝试 ping localhost

  在缺失127.0.0.1 localhost的情况下,会出现Cannot connect to the service... 错误,修改之后selenium使用正常
 

发布了267 篇原创文章 · 获赞 36 · 访问量 19万+

猜你喜欢

转载自blog.csdn.net/qq_40270754/article/details/101022414
今日推荐