Selenium Python
最后更新于:2022-04-02 03:42:21
[TOC]
> [教程](http://www.testclass.net/selenium_python/install-selenium)
## 安装 selenium
```
pip3 install selenium
```
## 各个浏览器驱动
Firefox浏览器驱动:[geckodriver](https://github.com/mozilla/geckodriver/releases)
Chrome浏览器驱动:[chromedriver](https://sites.google.com/a/chromium.org/chromedriver/home),[taobao备用地址](https://npm.taobao.org/mirrors/chromedriver)
IE浏览器驱动:[IEDriverServer](http://selenium-release.storage.googleapis.com/index.html)
Edge浏览器驱动:[MicrosoftWebDriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver)
Opera浏览器驱动:[operadriver](https://github.com/operasoftware/operachromiumdriver/releases)
PhantomJS浏览器驱动:[phantomjs](http://phantomjs.org/)
### 安装 chromedriver
```
choco install chromedriver
```
如 choco 安装失败,则手动添加到 path
## hello word
```
from selenium import webdriver
if __name__ == '__main__':
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
print(driver.title)
driver.quit()
```
';