马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 蛊惑的心 于 2018-8-3 23:52 编辑
今天刚刚装selenium,看网上的教程运行了一段代码from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://www.baidu.com/')
然后chrome打开了,但是百度网页却没有打开,而且一段时间后自动退出chrome且报错
报错如下:
Traceback (most recent call last):
File "C:/Users/头条杀机/AppData/Local/Programs/Python/Python37/aa.py", line 3, in <module>
browser = webdriver.Chrome()
File "C:\Users\头条杀机\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__
desired_capabilities=desired_capabilities)
File "C:\Users\头条杀机\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\头条杀机\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 251, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\头条杀机\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "C:\Users\头条杀机\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception: Chrome version must be >= 67.0.3396.0
(Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.3.9600 x86_64)
我的chrome版本是68.0.3440.84
chrome驱动版本是2.4(它写着支持67-69),环境变量我设置在另一个盘符下了,和chrome.exe不在一个文件夹(不知道是否有影响)
所以为什么会出现这样的错误呢,为什么和教程结果不一样呢。。
|