SELEnium安装

来源:互联网 发布:淘宝奢侈品拍卖真假 编辑:程序博客网 时间:2024/05/22 14:05

Mac Os

1.pip install selenium

2.安装node.js(百度到官网下载最新版本)

3.使用node.js安装PhantomJS(npm install phantomjs -g)

4.下载chromedriver.


from selenium import webdriver


browser = webdriver.Chrome()


WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home


使用webdriver的时候,会报错,就算chrome的path传入,依然会报错。

下载chromedriver,将其拷贝至/usr/local/bin就可以解决

chromedriver版本参考http://blog.csdn.net/huilan_same/article/details/51896672

参考https://sites.google.com/a/chromium.org/chromedriver/getting-started。

原创粉丝点击