from selenium import webdriver
dr = webdriver.Chrome()
運行時報錯:
問題分析:
1、沒有下載chromedriver.exe
2、chromedriver.exe版本不對
解決方案:
根據Chrome的版本號,找到與之對應的Chromedriver.exe,地址https://chromedriver.storage.googleapis.com/index.html
1、添加Chromedriver.exe到系統變量中或者Python根目錄下
2、代碼改寫:dr = webdriver.Chrome(Chromedriver.exe的路徑)