天天看點

selenium啟動報錯:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

錯誤提示:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80

原因:

Chrome版本和ChromeDriver版本不一緻,極有可能是Chrome浏覽器自動更新了新版本,導緻兩者版本差異,運作不了。

解決方法:

1)檢視Chrome浏覽器的版本

selenium啟動報錯:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

我這裡是83版本的;

2)下載下傳對應版本的ChromeDriver

下載下傳位址:ChromeDriver

selenium啟動報錯:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

我下載下傳的是上面的83版本最後一個,當然是最新的了,因為我的Chrome就是最新的。

3)查找

chromedrciver.exe

的位置

在指令行視窗輸入:

where chromedriver
selenium啟動報錯:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

就可以看到安裝的它的位置。

4)替換

直接将剛下載下傳的chromedriver.exe放到上面的位置,進行替換,就大功告成了。

參考連結:

1、谷歌更新後,chromedriver如何更換新版本

2、Selenium chromeDriver啟動時報錯:session not created: This version of ChromeDriver only supports Chrome