Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 2fbeb81

Browse files
committed
fix: 更改参数获取bug
1 parent b7646af commit 2fbeb81

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

my_xxt/api.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,15 @@ def create_from(self, work_url: str) -> dict:
406406
# 解析做作业的页面的url
407407
do_work_url_params = urlparse(work_view_html.url)
408408
do_work_params = parse.parse_qs(do_work_url_params.query)
409-
try:
410-
for _input in input_date:
409+
410+
for _input in input_date:
411+
try:
411412
_key = re.findall(r'id="(.*?)"', str(_input))
412413
_value = str(_input.attrs['value'])
413414
commit_date_form[_key[0]] = _value
414-
except Exception as e:
415-
commit_date_form = commit_date_form
415+
except Exception as e:
416+
continue
417+
416418
commit_date = {
417419
"_classId": work_date["_classId"][0],
418420
"courseid": work_date["courseid"][0],
@@ -572,8 +574,8 @@ def create_from_data(self, commit_from: dict, answer: list) -> dict:
572574
:return:
573575
"""
574576
commit_from_1 = {
575-
"courseId": commit_from["courseId"],
576-
"classId": commit_from["classId"],
577+
"courseId": commit_from["courseid"],
578+
"classId": commit_from["_classId"],
577579
"knowledgeId": commit_from["knowledgeId"],
578580
"cpi": commit_from["cpi"],
579581
"workRelationId": commit_from["workRelationId"],

0 commit comments

Comments
 (0)