mzhhh / pkuelective2021spring Goto Github PK
View Code? Open in Web Editor NEWPKUAutoElective for 2021 spring semester
License: MIT License
PKUAutoElective for 2021 spring semester
License: MIT License
[INFO] loop, 00:11:27, ------------------------------
[INFO] loop, 00:11:27,
[INFO] loop, 00:11:27, > Current client: 1 (qsize: 2)
[INFO] loop, 00:11:27, > Client expired time: 2021-05-29 00:19:26
[INFO] loop, 00:11:27, User-Agent: Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.0
[INFO] loop, 00:11:27,
[INFO] loop, 00:11:27, Get SupplyCancel page 1
[INFO] loop, 00:11:27, Page dump to elective.get_SupplyCancel_1622218287099.html
[ERROR] loop.error, 00:11:27, [104] unable to parse HTML content
[WARNING] loop, 00:11:27, UnexceptedHTMLFormat encountered
修改const.py,在SupplyCancel变量中补充xh参数(学号)即可正常使用,例如https://elective.pku.edu.cn/elective2008/edu/pku/stu/elective/controller/supplement/SupplyCancel.do?xh=xxxxxxxxxx
在使用刷课机一段时间后会报错如下:
HTTPSConnectionPool(host='elective.pku.edu.cn', port=443): Max retries exceeded with url: /elective2008/ssoLogin.do?_rand=0.37325861354437806&token=13ebefa7a7ff3e73b0deef964739be80 (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)))
[WARNING] loop, 12:46:21, RequestException encountered
且人工手动登陆选课网也无法成功,即“当前无法使用此页面elective.pku.edu.cn 未发送任何数据。”
编程0基础,具体问题如下:
[ERROR] loop.error, 23:48:57, [104] unable to parse HTML content [WARNING] loop, 23:48:57, UnexceptedHTMLFormat encountered
显示“您尚未登录或者会话超时,请重新登录。”,应该是选课网api更新的结果。请问如何解决?
该程序选处于选课计划第一页的课程时工作正常,但选处于计划非第一页的时候找不到课程(尽管在config.ini中已正确设置)。怀疑是选课网“翻页”相关的api更新了。
某门课程实际未被选中却变为ignored tasks,显示该课程permission required,终止程序再启动后恢复为current tasks,该情况出现了两次。但此前曾使用该程序补选成功过一门课,并未发生上述情况,2020版的程序也未出现过。
发现课程有位置后抓取验证码,之后程序中断,显示
loop.error, 'NoneType' object has no attribute 'tobytes'
Traceback (most recent call last):
File "D:\PKUElective2021Spring\autoelective\loop.py", line 527, in run_elective_loop
captcha.save(CAPTCHA_CACHE_DIR)
File "D:\PKUElective2021Spring\autoelective\captcha\captcha.py", line 47, in save
md5 = xMD5(oim.tobytes())
AttributeError: 'NoneType' object has no attribute 'tobytes'
class Environ(object, metaclass=Singleton):
^
SyntaxError: invalid syntax
不敢自己乱改代码。。。
应该改名为 apikey.json
README里写错误导了
运行期间的某些时刻,有多个验证码(几乎同时)识别成功,但是并没有成功选课。
[ERROR] loop.error, 15:18:58, [103] unable to get normal Supplement page 3
[WARNING] loop, 15:18:58, OperationFailedError encountered
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.