解决办法 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使用正常