onion-rain / uestc_health_report

uestc研究生健康打卡
MIT License
38 stars 11 forks source link

每日打卡打卡信息不完整 现在还有绿码和是否接种的字段需要填写 #11

Open ZouTaooo opened 2 years ago

Mashiro-Sorata commented 2 years ago

只知道绿码和已接种的填写方式,在daily_report_data中的数据加入以下数据。

    "VACCINATION": "1",
    "VACCINATION_DISPLAY": "已全程接种",
    "TF_HEALTH_CODE": "1",
    "TF_HEALTH_CODE_DISPLAY": "绿码"

其他非绿码或者未接种的数据需要自己抓包看一下才知道了

xuqinkun commented 2 years ago

develop分支解决了这个issue,数据从服务器获取,只需修改下日期。如果系统又更改了数据格式,那么需要手动打卡一次。并且现在只需提供账号密码,不用编辑那一大段信息。

ZouTaooo commented 2 years ago

develop分支解决了这个issue,数据从服务器获取,只需修改下日期。如果系统又更改了数据格式,那么需要手动打卡一次。并且现在只需提供账号密码,不用编辑那一大段信息。

zt@ndsl81:~/uestc_health_report$ python3 cv_main.py ./geckodriver /usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " cv_main.py:69: DeprecationWarning: executable_path has been deprecated, please pass in a Service object self.driver = webdriver.Firefox(executable_path=webdriver_path, options=options) Traceback (most recent call last): File "cv_main.py", line 364, in check_job() File "cv_main.py", line 347, in check_job reporter = Reporter(account) File "cv_main.py", line 69, in init self.driver = webdriver.Firefox(executable_path=webdriver_path, options=options) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 179, in init RemoteWebDriver.init( File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 268, in init self.start_session(capabilities, browser_profile) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 359, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute self.error_handler.check_response(response) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1

新的develop分支运行会出错 对驱动有要求吗?

xuqinkun commented 2 years ago

这个问题有点像是你模块没有安装完整,因为requirements.txt里面有个pywin32==300,这个地方在非windows系统下会安装报错,导致后面的module安装不上

ZouTaooo commented 2 years ago

这个问题有点像是你模块没有安装完整,因为requirements.txt里面有个pywin32==300,这个地方在非windows系统下会安装报错,导致后面的module安装不上

但是上个版本的代码 我在ubuntu 服务器版本上是可以跑的

xuqinkun commented 2 years ago

应该是我把无窗口登录给注释掉了的原因,我改了,你更新下代码试试呢 image

ZouTaooo commented 2 years ago

应该是我把无窗口登录给注释掉了的原因,我改了,你更新下代码试试呢 image

好起来了,但是有了个新bug好像 1638785155(1)

xuqinkun commented 2 years ago

应该是我把无窗口登录给注释掉了的原因,我改了,你更新下代码试试呢 image

好起来了,但是有了个新bug好像 1638785155(1) image 异步刷新问题,更新下代码

ZouTaooo commented 2 years ago

应该是我把无窗口登录给注释掉了的原因,我改了,你更新下代码试试呢 image

好起来了,但是有了个新bug好像 1638785155(1) image 异步刷新问题,更新下代码

err_msg = self.driver.find_element_by_id('msg').text Traceback (most recent call last): File "cv_main.py", line 115, in _check WebDriverWait(self.driver, 5).until(EC.presence_of_element_located( File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 89, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Stacktrace: WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:393:5 element.find/</<@chrome://remote/content/marionette/element.js:299:16

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "cv_main.py", line 362, in check_job() File "cv_main.py", line 346, in check_job reporter.login() File "cv_main.py", line 129, in login if _check(): File "cv_main.py", line 119, in _check err_msg = self.driver.find_element_by_id('msg').text File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 472, in find_element_by_id return self.findelement(by=By.ID, value=id) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 1244, in find_element return self.execute(Command.FIND_ELEMENT, { File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute self.error_handler.check_response(response) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="msg"] Stacktrace: WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:393:5 element.find/</<@chrome://remote/content/marionette/element.js:299:16

xuqinkun commented 2 years ago

应该是我把无窗口登录给注释掉了的原因,我改了,你更新下代码试试呢 image

好起来了,但是有了个新bug好像 1638785155(1) image 异步刷新问题,更新下代码

err_msg = self.driver.find_element_by_id('msg').text Traceback (most recent call last): File "cv_main.py", line 115, in _check WebDriverWait(self.driver, 5).until(EC.presence_of_element_located( File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 89, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Stacktrace: WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:393:5 element.find/</<@chrome://remote/content/marionette/element.js:299:16

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "cv_main.py", line 362, in check_job() File "cv_main.py", line 346, in check_job reporter.login() File "cv_main.py", line 129, in login if _check(): File "cv_main.py", line 119, in _check err_msg = self.driver.find_element_by_id('msg').text File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 472, in find_element_by_id return self.findelement(by=By.ID, value=id) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 1244, in find_element return self.execute(Command.FIND_ELEMENT, { File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute self.error_handler.check_response(response) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="msg"] Stacktrace: WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:393:5 element.find/</<@chrome://remote/content/marionette/element.js:299:16

已解决,请更新代码

ZouTaooo commented 2 years ago

应该是我把无窗口登录给注释掉了的原因,我改了,你更新下代码试试呢 image

好起来了,但是有了个新bug好像 1638785155(1) image 异步刷新问题,更新下代码

err_msg = self.driver.find_element_by_id('msg').text Traceback (most recent call last): File "cv_main.py", line 115, in _check WebDriverWait(self.driver, 5).until(EC.presence_of_element_located( File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 89, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Stacktrace: WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:393:5 element.find/</<@chrome://remote/content/marionette/element.js:299:16 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "cv_main.py", line 362, in check_job() File "cv_main.py", line 346, in check_job reporter.login() File "cv_main.py", line 129, in login if _check(): File "cv_main.py", line 119, in _check err_msg = self.driver.find_element_by_id('msg').text File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 472, in find_element_by_id return self.findelement(by=By.ID, value=id) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 1244, in find_element return self.execute(Command.FIND_ELEMENT, { File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute self.error_handler.check_response(response) File "/home/zt/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="msg"] Stacktrace: WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:393:5 element.find/</<@chrome://remote/content/marionette/element.js:299:16

已解决,请更新代码

OK了 家人们 没毛病