在自動化過程中,昨天還能正常運行的代碼,第二天就一直出現報錯信息:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 93
Current browser version is 95.0.4638.54 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
出現此問題的原因是Chrome瀏覽器自動升級了,為了避免后續再出現這樣的問題,可把Chrome瀏覽器自動升級關閉。
關閉Chrome瀏覽器自動升級的步驟如下:
1. 打開運行,可通過WIN+R按鈕打開

2. 在輸入框中輸入services.msc,點擊回車。

3. 在服務頁面,往下滑動頁面,找到“Google Update Service(gupdate)”即“Google更新服務(gupdate)”,雙擊打開。

4. 在彈出頁面,啟動類型選擇disable,再點擊OK,重啟電腦后,谷歌瀏覽器Chrome就禁止自動升級了。
