Devin-Kung / xxqg

学习强国 xxqg 无人值守自动看视频、看文章、自动答题(每日答题、每周答题、专项答题),45分/天
MIT License
433 stars 127 forks source link

1.0.8.0缺少 #32

Open 506430136 opened 3 years ago

506430136 commented 3 years ago

报错如下: Traceback (most recent call last): File "E:/xxqg-1.0.8.0/xuexi.py", line 116, in exam_temp_Path = './data/exam_temp.json'

应该是/data/exam_temp.json文件没有,这个文件能发一下吗?

Devin-Kung commented 3 years ago

报错如下: Traceback (most recent call last): File "E:/xxqg-1.0.8.0/xuexi.py", line 116, in exam_temp_Path = './data/exam_temp.json'

应该是/data/exam_temp.json文件没有,这个文件能发一下吗?

这是运行中生成的一个临时文件,运行结束就会删除,没有这个文件不会影响程序运行的 这段报错后面应该还有内容吧,是不是没有复制完整,请将报错内容完整发出来,以便排查问题

506430136 commented 3 years ago

发现了,这个我刚看到了 应该是检测浏览器的问题,公司网络可能限制了,但是我本地的驱动和浏览器版本是一致的,1.0.5.0版一致用的版本,现在报下面的错: Traceback (most recent call last): File "E:/xxqg-1.0.8.0/xuexi.py", line 113, in browser = XuexiChrome(path.join(getcwd(), 'chromedriver.exe'), options=chrome_options) File "E:\xxqg-1.0.8.0\custom\xuexi_chrome.py", line 10, in init super().init(executable_path, port, options, service_args, desired_capabilities, service_log_path, File "C:\Program Files\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init RemoteWebDriver.init( File "C:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "C:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Program Files\Python38\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: This version of ChromeDriver only supports Chrome version 91 Current browser version is 90.0.4430.212 with binary path C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe

506430136 commented 3 years ago

def get_latest_version(): url = 'https://api.github.com/repos/PRaichu/xxqg/releases/latest' headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36' } 这里的url也不是每次都能打开,所以我把 latest_version = '1.0.8.0' 这个直接赋值了,后面就是浏览器闪一下就关闭了

Devin-Kung commented 3 years ago

def get_latest_version(): url = 'https://api.github.com/repos/PRaichu/xxqg/releases/latest' headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36' } 这里的url也不是每次都能打开,所以我把 latest_version = '1.0.8.0' 这个直接赋值了,后面就是浏览器闪一下就关闭了

浏览器闪退可能是因为版本太低了,先更新一下浏览器版本,再使用最新的脚本程序运行,如果是win10系统建议直接使用打包好的程序,无需用源码

506430136 commented 3 years ago

是版本问题,已经可以了,谢谢

506430136 commented 3 years ago

打包的程序怎么下载?还是需要自己打包?

Devin-Kung commented 3 years ago

Releases中找到最新的版本,下载xuexi.zip,,解压后运行xuexi.exe image

506430136 commented 3 years ago

谢谢