前期准备:
1.安装Python (建议3.6 比较稳定)
2. 安装selenium包 (以下二选一)
方法一:pycharm 中安装
方法二: cmd pip install semenium
3.与浏览器对应的驱动 (驱动下载后直接放在Python安装路径中 调用时就不用写路径了)
Chrome:https://sites.google.com/a/chromium.org/chromedriver/downloads
备用地址:http://chromedriver.storage.googleapis.com/index.html
Firefox:https://github.com/mozilla/geckodriver/releases
IE::http://selenium-release.storage.googleapis.com/index.html
![](https://img.haomeiwen.com/i11448275/c944abc7feed8297.png)
eg:这样就可以启动浏览器了
![](https://img.haomeiwen.com/i11448275/116c1fee76eaa78a.png)
网友评论