以前还可以正常使用,结果一段时间再使用的时候便运行错误,已经更新到最新版本,包卸载重装都不行 代码 - import time
- from selenium import webdriver
-
- url = 'https://cy.ncss.cn/information/dsdt?typeCode=CYDS_2TH_DSDT'
- brower = webdriver.Chrome()
- brower.get(url)
-
- print('666')
- brower.find_element_by_xpath("//button[text()='下一步']").click() #登录
- time.sleep(1)
-
- brower.find_element_by_xpath("//label[text()='健康']").click() #健康
- time.sleep(1)
- brower.find_element_by_xpath("//label[text()='否']").click() #是否从学校外出
- time.sleep(1)
- brower.find_element_by_xpath('//*[@id="post"]').click() #提交
- time.sleep(1)
- brower.find_element_by_xpath('//a[text()="确定"]').click() #确认提交无误
- time.sleep(1)
- brower.quit() #关闭浏览器
复制代码异常 - Traceback (most recent call last):
- File "C:\Users\lenovo\Desktop\大创\测试代码1.py", line 16, in <module>
- brower = webdriver.Chrome()
- File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
- service_log_path, service, keep_alive)
- File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 99, in __init__
- options=options)
- File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__
- self.start_session(capabilities, browser_profile)
- File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 359, in start_session
- response = self.execute(Command.NEW_SESSION, parameters)
- File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
- self.error_handler.check_response(response)
- File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37-32\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 88
- Current browser version is 97.0.4692.71 with binary path C:\Users\lenovo\AppData\Local\Google\Chrome\Application\chrome.exe
- Stacktrace:
- Backtrace:
- GetHandleVerifier [0x00E4B963+483]
- GetHandleVerifier [0x00E4B941+449]
- GetHandleVerifier [0x011F3308+3832712]
- GetHandleVerifier [0x0120D69A+3940122]
- GetHandleVerifier [0x01209AFB+3924859]
- GetHandleVerifier [0x01207D9C+3917340]
- GetHandleVerifier [0x0122E7FE+4075646]
- GetHandleVerifier [0x0122E56C+4074988]
- GetHandleVerifier [0x0122B2EB+4062059]
- GetHandleVerifier [0x0120ED14+3945876]
- GetHandleVerifier [0x0120FBCE+3949646]
- GetHandleVerifier [0x0120FB59+3949529]
- Ordinal0 [0x00E0B5CC+46540]
- Ordinal0 [0x00E09F53+40787]
- Ordinal0 [0x00E09B12+39698]
- GetHandleVerifier [0x01111468+2907368]
- GetHandleVerifier [0x00F571EE+1096302]
- GetHandleVerifier [0x00F13E8D+821005]
- GetHandleVerifier [0x00F1396B+819691]
- GetHandleVerifier [0x00F13881+819457]
- GetHandleVerifier [0x00F3F463+998627]
- BaseThreadInitThunk [0x7570FA29+25]
- RtlGetAppContainerNamedObjectPath [0x77847A9E+286]
- RtlGetAppContainerNamedObjectPath [0x77847A6E+238]
复制代码
|