python使用selenium操作chrome浏览器

306 阅读1分钟

安装驱动

  • 首先查看浏览器版本,然后到下面地址下载对应版本驱动 chromedriver.chromium.org/downloads
  • 下载后解压,将路径放入环境变量中
  • 进入命令行启动 chromedriver

使用python调用

确保 chromedriver 驱动运行

安装 selenium 模块

pip install selenium