1、selenium安装
pycharm方式安装
2.
chromedriver下载
下载地址:
https://www.selenium.dev/documentation/en/webdriver/driver_requirements/
http://npm.taobao.org/mirrors/chromedriver
查询chrom的版本号
然后下载对应版本chromedriver
验证是否安装成功,在cmd中输入chromdriver
import selenium from selenium import webdriver def test_selenium(): driver = webdriver.Chrome() driver.get("https://www.baidu.com/")