1. 相關鏈接
- 官方網站:http://www.seleniumhq.org
- GitHub:https://github.com/SeleniumHQ/selenium/tree/master/py
- PyPI:https://pypi.python.org/pypi/selenium
- 官方文檔:http://selenium-python.readthedocs.io
- 中文文檔:http://selenium-python-zh.readthedocs.io
2. pip安裝
這里推薦直接使用pip安裝,執行如下命令即可:
|
pip3 install selenium |
3. wheel安裝
此外,也可以到PyPI下載對應的wheel文件進行安裝(下載地址:https://pypi.python.org/pypi/selenium/#downloads),如最新版本為3.4.3,則下載selenium-3.4.3-py2.py3-none-any.whl即可。
然后進入wheel文件目錄,使用pip安裝:
1 |
pip3 install selenium-3.4.3-py2.py3-none-any.whl |
4. 驗證安裝
進入Python命令行交互模式,導入Selenium包,如果沒有報錯,則證明安裝成功:
1 2 |
$ python >>> import selenium |