无法访问Python Selenium ChromeDriver
所以我无法理解为什么会出现这种异常。当我单独运行chromedriver时,我得到: 在端口9515上启动ChromeDriver 2.15.322448(52179c1b310fec1797c81ea9a20326839860b7d3) 当我尝试从文件运行它时,我得到: WebDriverException:消息:无法访问chrome(驱动程序信息: 色度驱动器=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),平台=Linux 3.13.0-52-通用x86_64) 守则:无法访问Python Selenium ChromeDriver,python,selenium,selenium-chromedriver,Python,Selenium,Selenium Chromedriver,所以我无法理解为什么会出现这种异常。当我单独运行chromedriver时,我得到: 在端口9515上启动ChromeDriver 2.15.322448(52179c1b310fec1797c81ea9a20326839860b7d3) 当我尝试从文件运行它时,我得到: WebDriverException:消息:无法访问chrome(驱动程序信息: 色度驱动器=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),平台=Linux 3.
if self.proxy:
chrome_options = Options()
chrome_options.add_argument("--proxy-server=http://user:password@proxy.com:8080")
self.webdriver = webdriver.Chrome('/usr/bin/google-chrome', chrome_options=chrome_options)
else:
self.webdriver = webdriver.Chrome('/usr/bin/google-chrome')
我在没有代理的情况下运行它。如果我不提供路径,出于某种原因,它将无法找到chrome二进制文件。不确定我应该从这里走到哪里。您需要在中指定的路径是chromedriver的路径,而不是chrome本身:
self.webdriver = webdriver.Chrome('/path/to/chromedriver', chrome_options=chrome_options)
如果chromedriver
在中-您根本不需要指定路径-通常情况就是这样。下载并使用此代码
driver = webdriver.Chrome("C:\\chromedriver.exe")
人力资源管理,有道理。我的路径有些问题。我修复了它,现在甚至不用指定路径就可以启动它。但遗憾的是,我还是遇到了同样的错误(无论我是否指定了路径)。@user3084860是的,你是对的,
chrome not reachable
与smth else有关。根据我在谷歌上搜索的内容,有很多原因。你能检查一下你在实例化chrome时遇到的错误是否与刚才的self.webdriver=webdriver.chrome()
相同吗?谢谢