美文网首页
记录windows10 安装selenium步骤

记录windows10 安装selenium步骤

作者: 唐植超 | 来源:发表于2021-07-13 10:32 被阅读0次

1.下载安装python最新版

https://www.python.org/downloads/release/python-396/

安装注意事项:

  • 选择自定义安装,不要用默认安装,不要装C盘,不然可能有权限问题
  • 勾选设置环境变量
  • 最后一步一定要disable path length limit
  1. 安装PyCharm 怎么破解我不说了,自己想办法
    3.下载chromedrver.exe 地址可能会变化,要根据自己的浏览器版本,下载解压,exe直接放入python目录
https://npm.taobao.org/mirrors/chromedriver/91.0.4472.19/
  1. 安装selenium
pip -m install selenium

5.启动pycharm ,新建项目 test,然后 files >>> settings >>> project: test >>> python Interpreter
点击 齿轮 >>> add >>> Virtualevn Evnironment >>> Existing environment
选择python 路径 ,勾选 Make available to all projects

  1. 保存设置
  2. 新建 phthon 文件,示例代码如下
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.baidu.com/')

相关文章

网友评论

      本文标题:记录windows10 安装selenium步骤

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