工欲善其事必先利其器
1式塌、安裝python
2、安裝pycharm,新建項目
3、cmd命令pip安裝selenium:pip install selenium(建議參照第5點性芬,在pycharm導(dǎo)入selenium)
安裝完成后pip list 命令查看已安裝列表清單,能看到selenium表示現(xiàn)在成功
4剧防、下載瀏覽器驅(qū)動webdriver植锉,放在python的路徑下(webdriver跟瀏覽器存在映射關(guān)系,需跟版本對應(yīng)上)
火狐驅(qū)動:https://github.com/mozilla/geckodriver/releases/
谷歌驅(qū)動:http://npm.taobao.org/mirrors/chromedriver
IE驅(qū)動:http://selenium-release.storage.googleapis.com/index.html
Edge驅(qū)動(win10):https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
火狐瀏覽器選擇27~32之間的版本
5诵姜、在pycharm導(dǎo)入selenium
附教程地址:
Python + selenium自動化環(huán)境搭建的完整步驟:https://www.jb51.net/article/140435.htm
Python + Selenium環(huán)境搭建(包含部署瀏覽器驅(qū)動):http://www.reibang.com/p/8388a745a2b2
selenium原理:https://cloud.tencent.com/developer/article/1005264
pycharm中導(dǎo)入selenium:https://blog.csdn.net/liuyuqing2018/article/details/82775528
【Selenium】Geckodriver版本(更新至V0.24.0)與Firefox版本(更新至65)映射關(guān)系:https://blog.csdn.net/u013250071/article/details/78803230
通過pip工具安裝selenium(初次安裝汽煮、升級搏熄、降級):https://www.cnblogs.com/benpao1314/p/8940713.html