- 安装selenium
pip install selenium
验证是否安装成功:pip show selenium
- 安装Chromedriver
a.安装对应版本 ChromedriverURL
b.解压安装包,将Chromedriver.exe复制进Chrome安装目录下(…/chrome/Application)
c.并复制Chromedriver.exe新路径(…/Application)至path中
chrome版本81.0.4044.122,对应chromedriver81.0.4044.20
验证是否安装成功:chromedriver
- 报错情况
from selenium import webdriver
a = webdriver.chrome()
a.get("https://www.baidu.com")

报错 :‘module’ object is not callable
原因:chrome首字母没有大写
from selenium import webdriver
a = webdriver.Chrome()
a.get("https://www.baidu.com")
本文详细介绍了如何使用pip安装Selenium,并正确配置ChromeDriver以实现自动化浏览器操作。包括了Selenium的验证安装,ChromeDriver的下载、解压及环境变量设置步骤,以及常见错误的解决方法。


4841

被折叠的 条评论
为什么被折叠?



