stay webdriver function Chrome The following error is reported when the drive is running , Because Chrome The version of the drive does not support the current Chrome Version of ( Generally, it is upgraded manually or automatically Chrome Browser version ).
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 88
To solve such a problem , There are two ways :
Method 1 :
Download from official website chromedriver Supported by Chrome Browser version , The biggest drawback of this method is that it misses the compatibility problem ( Abreast of the times Chrome Whether the browser version will be compatible with the product ).Chrome There is no official offer to download the old version , Here are some other sources , You can find it by yourself .
Chrome Old version download
Method 2 :
Download support current Chrome Browser version of chromedriver, The link is attached below :
chromedriver download
Downloaded chromedriver There are two ways to use :
1, Directly into the installed python Under the path
2, In the use of web.Chrome() When , Appoint chromewebdriver The address of , This method is more recommended in the project .
from selenium import webdriver
chromeDriverPath='E:\Tool\Python-3.8.2\chromedriver.exe' #chromedriver.exe Where it is
driver = webdriver.Chrome(executable_path=chromeDriverPath)
driver.get('http://www.baidu.com')
print('Open success!')
Python Crawler series happy jo
Article table of contentsCreat