作者jason59420 (哲哲爱猫)
看板Linux
标题[问题] Chromedriver不能跑 与chrome版本不同?
时间Tue Feb 4 18:28:43 2020
Linux和编程方面都还是新手 求鞭小力一点QQ
如题 在ubuntu上跑一个python的时候出现这样的问题
上网爬了一下有人说是chrome跟chromedriver版本不合
接着我把chrome跟chromedriver的版本都升到79
再重新跑一次还是一样失败 错误讯息都是写这样
jason@jason-BM5275-BM5375-BM5675:$ python one.py
one.py:31: DeprecationWarning: use options instead of chrome_options
driver = webdriver.Chrome(r"selenium_driver_chrome/chromedriver",chrome_opti
ons=options)
Traceback (most recent call last):
File "one.py", line 31, in <module>
driver = webdriver.Chrome(r"selenium_driver_chrome/chromedriver",chrome_op
tions=options)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdr
iver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdr
iver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdr
iver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdr
iver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/error
handler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not cr
eated: This version of ChromeDriver only supports Chrome version 76
jason@jason-BM5275-BM5375-BM5675:$ chromedriver --version
ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branc
h-heads/3945@{#614})
jason@jason-BM5275-BM5375-BM5675:$ chromium-browser --version
Chromium 79.0.3945.79 Built on Ubuntu , running on Ubuntu 18.04
我该怎麽解决这个问题呢?
把版本都降到76吗
Chromedriver降到76我会 也尝试过一样失败
Chrome找不到方法降回76 QQ
如果需要ubuntu版本我等等补上 应该是18.多
希望有人帮一下小新手 感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 49.216.4.187 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Linux/M.1580812125.A.810.html
※ 编辑: jason59420 (49.216.4.187 台湾), 02/04/2020 18:36:53
1F:推 Kitten1156: 你是怎麽升级chromedriver的? 02/05 08:02
2F:推 Kitten1156: 我都直接抓新的driver指定路径就能用了 02/05 08:04