diff --git a/src/course/foreWork.py b/src/course/foreWork.py index c55e73bb..47e7dfb6 100644 --- a/src/course/foreWork.py +++ b/src/course/foreWork.py @@ -134,7 +134,7 @@ def find_objectives(usernm, chapterids, course_id, session): resp = session.get(url, headers=header) try: content = str(json.loads(resp.text)['data'][0]['card']['data']).replace('"', '') - result = re.findall('{objectid:(.*?),.*?,_jobid:(.*?),', content) + result = re.findall('[{,]objectid:(.*?)[},].*?[{,]_jobid:(.*?)[},]', content) jobs[lesson_id] = result console.log('在章节{}中找到[yellow bold]{}[/yellow bold]个任务点'.format(lesson_id, len(result))) except Exception as e: