|
今天在跑一个之前写的Python程序时报错:
F:\workplace\5iDHL>getwaybills.py
[13044:10988:1221/171916.634:ERROR:policy_loader_win.cc(505)] PReg file doesn't exist: C:\WINDOWS\System32\GroupPolicy\User\Registry.pol
DevTools listening on ws://127.0.0.1:12084/devtools/browser/3553e8bc-6f51-465a-9bf5-1c7ae3048a2f
Traceback (most recent call last):
File "F:\workplace\5iDHL\getWaybills.py", line 12, in <module>
driver.get(loginUrl);
File "C:\Users\sunnybirds\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 323, in get
self.execute(Command.GET, {'url': url})
File "C:\Users\sunnybirds\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 311, in execute
self.error_handler.check_response(response)
File "C:\Users\sunnybirds\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: missing or invalid 'entry.level'
(Session info: chrome=63.0.3239.84)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.16299 x86_64)
错误说C:\WINDOWS\System32\GroupPolicy\User\Registry.pol的这个文件不存在了,难道是模块损坏了?于是卸载重装selenium模块,没有解决问题。
看来这锅得摔给windows 10了,既然模块没有问题,那就是系统的问题了(不然怎么会爆出系统盘的系统文件少了,肯定是系统更新的时候删了)。
于是把C:\Windows\System32\GroupPolicy\Machine下的Registry.pol复制到C:\WINDOWS\System32\GroupPolicy\User\,问题解决。
然而还是不能运行,出了一个新问题:
F:\workplace\5iDHL>getwaybills.py
DevTools listening on ws://127.0.0.1:12075/devtools/browser/53a8dc11-90b6-47e1-be1f-9e96ee0fc7f6
Traceback (most recent call last):
File "F:\workplace\5iDHL\getWaybills.py", line 12, in <module>
driver.get(loginUrl);
File "C:\Users\sunnybirds\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 323, in get
self.execute(Command.GET, {'url': url})
File "C:\Users\sunnybirds\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 311, in execute
self.error_handler.check_response(response)
File "C:\Users\sunnybirds\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: missing or invalid 'entry.level'
(Session info: chrome=63.0.3239.84)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.16299 x86_64)
问题出在chrome与chromedriver版本号不匹配,将chromedriver升级即可解决问题
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-23 09:18
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社