美文网首页
mac 搭建 python + selenium+ chrome

mac 搭建 python + selenium+ chrome

作者: 取名好费劲 | 来源:发表于2021-04-02 18:07 被阅读0次
  1. 先下载selenium 进入终端执行 pip install selenium
    再使用 pip show selenium显示是否安装成功
  2. 下载chrome driver 包,根据自己电脑安装的版本选择对应的
    下载地址 http://npm.taobao.org/mirrors/chromedriver/
  3. 把下载好的chromedriver 拷贝到 /usr/local/bin 下,执行cp chromedriver /usr/local/bin
  4. 环境配置好了就可以开始写代码了,简单代码如下:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")

相关文章

网友评论

      本文标题:mac 搭建 python + selenium+ chrome

      本文链接:https://www.haomeiwen.com/subject/osuhkltx.html