selenium 開始使用時出現的坑
chrome 80.0.3987.116時按以前的用法時出現的錯誤
1.程序先從 selenium 引入 webdriver,引入 chrome 程序的選擇項目 Options:
老版本可用:from selenium.webdriver.driver.options import Options
但是在chrome 80.0.3987.116時報錯
需要調整爲:from selenium.webdriver.chrome.options import Options
2.程序可以正常運行但出現以下錯誤
DeprecationWarning: use options instead of chrome_options driver = webdriver.Chrome(chrome_options=chrome_options)
以上錯誤只提示警告信息但不影響運行
需要將“chrome_options”改成“options”即可,此問題應該在最近的版本更改的,我使用的是selenium==3.141.0,有興趣的話可以去看官方文檔進行確定那個版本