赞
踩
成功解决:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 100
报错问题:
browser = webdriver.Chrome(chrome_options=chrome_options)
Traceback (most recent call last):
File "E:/Python/test3.py", line 73, in <module>
main()
File "E:/Python/test3.py", line 65, in main
baidu_search(search_keyword[0], max_page)
File "E:/Python/test3.py", line 52, in baidu_search
browser = webdriver.Chrome(chrome_options=chrome_options)
File "D:\Python3.8\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__
super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "D:\Python3.8\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 93, in __init__
RemoteWebDriver.__init__(
File "D:\Python3.8\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__
self.start_session(capabilities, browser_profile)
File "D:\Python3.8\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 359, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "D:\Python3.8\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
self.error_handler.check_response(response)
File "D:\Python3.8\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 100
Current browser version is 102.0.5005.115 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Stacktrace:
Backtrace:
Ordinal0 [0x00437413+2389011]
Ordinal0 [0x003C9F61+1941345]
Ordinal0 [0x002BC658+837208]
Ordinal0 [0x002DC773+968563]
Ordinal0 [0x002D837A+951162]
Ordinal0 [0x002D5C51+941137]
Ordinal0 [0x00308C80+1150080]
Ordinal0 [0x003088DA+1149146]
Ordinal0 [0x00303F66+1130342]
Ordinal0 [0x002DE546+976198]
Ordinal0 [0x002DF456+980054]
GetHandleVerifier [0x005E9632+1727522]
GetHandleVerifier [0x0069BA4D+2457661]
GetHandleVerifier [0x004CEB81+569713]
GetHandleVerifier [0x004CDD76+566118]
Ordinal0 [0x003D0B2B+1968939]
Ordinal0 [0x003D5988+1989000]
Ordinal0 [0x003D5A75+1989237]
Ordinal0 [0x003DECB1+2026673]
BaseThreadInitThunk [0x7674FA29+25]
RtlGetAppContainerNamedObjectPath [0x77087A9E+286]
RtlGetAppContainerNamedObjectPath [0x77087A6E+238]
Process finished with exit code 1
报错内容翻译:此版本的ChromeDriver仅支持Chrome版本100,需要升级Chrome驱动版本WebDriver
原因:ChromeDriver驱动需要对应的浏览器版本,而我的浏览器版本太低
1. 下载对应版本的Chrome驱动版本:http://chromedriver.storage.googleapis.com/index.html
2. 安装包解压后放进Python安装路径下:
以上是此问题报错原因的解决方法,欢迎评论区留言讨论是否能解决,如果有用欢迎点赞收藏文章谢谢支持,博主才有动力持续记录遇到的问题!!!
由于博主时间精力有限,每天私信人数太多,没办法每个粉丝都及时回复,所以优先回复VIP粉丝,可以通过订阅限时9.9付费专栏《100天精通Python从入门到就业》进入千人全栈VIP答疑群,获得优先解答机会(代码指导、远程服务),白嫖80G学习资料大礼包,专栏订阅地址:https://blog.csdn.net/yuan2019035055/category_11466020.html
优点:作者优先解答机会(代码指导、远程服务),群里大佬众多可以抱团取暖(大厂内推机会),此专栏文章是专门针对零基础和需要进阶提升的同学所准备的一套完整教学,从0到100的不断进阶深入,后续还有实战项目,轻松应对面试!
专栏福利:简历指导、招聘内推、每周送实体书、80G全栈学习视频、300本IT电子书:Python、Java、前端、大数据、数据库、算法、爬虫、数据分析、机器学习、面试题库等等
注意:如果希望得到及时回复,和大佬们交流学习,订阅专栏后私信博主进千人VIP答疑群
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。