安装
直接用pip install selenium
在调用chromedriver
的会出现
Message: ‘chromedriver’ executable needs to be in PATH
点击chromedriver下载相对自己Google Chrome
linux版本的,
然后解压。
得到一个
然后复制到sudo cp chromedriver /usr/bin/
给权限,不给会出错。
sudo chmod 777 chromedriver
这里/usr/bin
都是我安装chromedriver
和Python
的目录,根据自己的安装地方移动。如果Google Chrome
和Python
安装在不同的地方,那就要移动两次。