1.准备python环境
2.准备selenium环境

3.下载浏览器对应的driver版本



下载后解压,得到{解压后的driver路径}配到环境变量文件里
4.driver配置环境变量
>>cd ~
>>vim ./.bash_profile
文件内插入:
# webdriver
export PATH=${PATH}:{driver解压后的driver路径}
退出文件输入命令:
>>source ~/.bash_profile #使环境变量配置生效
5.在python中import对应的依赖
import selenium
网友评论