sevenwind

1.下载对应版本的驱动器

http://chromedriver.storage.googleapis.com/index.html

2.驱动器放在python的安装目录下

a.找到python的安装路径

终端输入which python,可以查出路径

Mac下/usr/local目录默认是对于Finder是隐藏,如果需要到/usr/local下去,打开Finder,然后使用command+shift+G,在弹出的目录中填写路径就可以了

b.把驱动器放在目录下

3.配置环境变量

打开终端

输入vi ./.bash_profile回车

输入i进入编辑模式

添加环境变量export PATH=$PATH:/usr/local/bin/chromedriver

点击“esc键,退出insert模式”, 然后输入“:wq!”,回车,保存成功

输入“source ./.bash_profile”,让环境变量生效

输入”echo $PATH”,查看环境变量,发现添加成功

4.赋予权限

sudo chmod u+x,o+x /usr/local/bin/chromedriver

 

参考文档:

https://www.cnblogs.com/sundaysgarden/p/10968764.html

https://blog.csdn.net/Rouckie/article/details/84555005

https://blog.csdn.net/qq_44846324/article/details/115458265

分类:

技术点:

相关文章:

  • 2021-07-09
  • 2021-05-25
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2021-12-16
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2021-10-01
  • 2022-02-09
  • 2022-12-23
  • 2021-11-18
  • 2022-02-09
  • 2021-12-23
相关资源
相似解决方案