selenium介绍与安装

官网:https://www.selenium.dev

Selenium的组成

Selenium Webdriver:提供接口驱动浏览器
Selenium IDE:chrome、firefox的插件,可录制浏览器上的操作
Selenium Grid:支持分布式,同时在多个浏览器上执行

selenium运行原理

我们用python、java等语言编写脚本,通过selenium将脚本发送给浏览器的驱动程序Driver,不同的浏览器有不同的Driver,Driver和浏览器进行交互。
selenium介绍与安装

selenium安装(python)

pip install selenium

Driver配置

官网:https://www.selenium.dev/documentation/en/webdriver/driver_requirements/

ChromeDriver下载(注:要与本地Chrome版本相同,否则无法使用):
淘宝镜像:https://npm.taobao.org/mirrors/chromedriver/

查看Chrome版本:

selenium介绍与安装