本文使用的是Windows 7,python3.7, Firefox。
翻译自:https://selenium-python.readthedocs.io/getting-started.html
不全是翻译, 其中有些部分是按照自己的理解写的,有不对的地方,希望大家可以留言。讨论和分享 ,学习才更有趣。
一.安装selenium:
-
Python 3.6的标准库中提供了pip,所以可以使用pip安装selenium。
-
使用命令安装selenium: pip install selenium
二.下载浏览器驱动
IE浏览器驱动:http://selenium-release.storage.googleapis.com/index.html
Firefox浏览器驱动:https://github.com/mozilla/geckodriver/releases
Chrome: https://sites.google.com/a/chromium.org/chromedriver/downloads