Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网页版式错误 #56

Closed
2 tasks done
Psalmi23187 opened this issue Mar 7, 2021 · 2 comments
Closed
2 tasks done

网页版式错误 #56

Psalmi23187 opened this issue Mar 7, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Psalmi23187
Copy link

Psalmi23187 commented Mar 7, 2021

Check List

Version / Environment

System infomation: [ ] ( Windows10 64bit, MacOS 10.13.6, Ubuntu 18.04.3 amd64, ... )
Python version: [ ] ( run python3 --version )
AutoElective version: [ ] ( run python3 main.py --version )

Config

[course:general2]

name = 中国近现代史纲要
class = 5
school = 马克思主义学院

[course:general3]

name = 社会性别研究
class = 1
school = 社会学系

Issue Description

What

在使用过程中会有UnexceptedHTMLFormat encountered

Console Log

[INFO] loop, 15:23:18,
[INFO] loop, 15:23:18, > Current client: 1 (qsize: 2)
[INFO] loop, 15:23:18, > Client expired time: 2021-03-07 15:26:30
[INFO] loop, 15:23:18, User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
[INFO] loop, 15:23:18,
[INFO] loop, 15:23:18, Get SupplyCancel page 1
[INFO] loop, 15:23:19, Page dump to elective.get_SupplyCancel_1615101799306.html
[ERROR] loop.error, 15:23:19, [104] unable to parse HTML content
[WARNING] loop, 15:23:19, UnexceptedHTMLFormat encountered

Reproduce

如有必要,提供复现的步骤

@zhongxinghong
Copy link
Owner

应该返回的是一个空页面,你可以看一下 log/web/${username}/elective.get_SupplyCancel_1615101799306.html 里面是什么

这个问题和 #44 相同

@zhongxinghong
Copy link
Owner

不好意思,之前没有仔细研究这个问题 ...... 现在报这个错误是因为选课网改了 HTML 的结构,导致会话超时的错误没有被正确捕获,如下修改代码可以暂时解决这个问题

修改 parser.pyget_errInfo 函数,添加对 "提示:" 的识别

assert strong.tag == 'strong' and strong.text in ('出错提示:', '提示:')

修改 hook.pycheck_elective_title 函数,添加对 "系统提示" 的识别

if title in ("系统异常", "系统提示"):

其它错误提示的格式有可能也变了, 但我目前暂时还没遇到与此类似的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants