Devin-Kung / xxqg

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

报错 #81

Open ceeveet opened 2 years ago

ceeveet commented 2 years ago

手动升级ChromeDriver版本号又报错

Traceback (most recent call last): File "xuexi.py", line 136, in File "xuexi.py", line 61, in run File "operation\exam.py", line 100, in to_exam File "operation\exam.py", line 50, in check_exam File "selenium\webdriver\remote\webdriver.py", line 1248, in find_element File "selenium\webdriver\remote\webdriver.py", line 425, in execute File "selenium\webdriver\remote\errorhandler.py", line 247, in check_response selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".ant-pagination-next"} (Session info: chrome=103.0.5060.53)

ElleLiu commented 2 years ago

更新 get_chromedriver.py - get_download_version 函数,就可以自动更新chromedriver了(需要 import pandas) :

def get_download_version(chrome_version): """ 根据本地Chrome版本号获取可下载的ChromeDriver版本号 :param chrome_version: 当前本地Chrome版本号前三位 :return: 完整版本号 """ google_api_url = 'https://registry.npmmirror.com/-/binary/chromedriver/' rep = loads(get(google_api_url).content.decode('utf-8')) df = pd.DataFrame.from_dict(rep).sort_values(by = 'modified',ascending=False) one = df.loc[df['name'].str.contains(chrome_version)].sort_values(by='modified',ascending=False).head(1) download_version = one['name'].values[0][:-1] return download_version

solife2020 commented 2 years ago

麻烦提供一份编译好的EXE文件,环境不好搭设啊 能否提供一下您修改好 的文件。谢谢

ElleLiu commented 2 years ago

麻烦提供一份编译好的EXE文件,环境不好搭设啊 能否提供一下您修改好 的文件。谢谢

源码里面没有提供exe文件呢好像,源码的环境我也不太了解,但是我搭虚拟环境3.6和3.8都试过,都能正常执行。

david12-t commented 2 years ago

我直接禁用chrome的自动更新