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

[BUG反馈]登录账号获取课程列表后报错 #333

Closed
nayooooo opened this issue Apr 19, 2024 · 3 comments
Closed

[BUG反馈]登录账号获取课程列表后报错 #333

nayooooo opened this issue Apr 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@nayooooo
Copy link

代码报错截图
屏幕截图 2024-04-20 000021

网页端课程报错任务点截图
此处上传出现报错的任务点的网页端截图

其他内容
您觉得对问题反馈有帮助的内容

@nayooooo nayooooo added the bug Something isn't working label Apr 19, 2024
@nayooooo
Copy link
Author

我尝试了python main.pypython main.py -c config.ini两种方法,都是同样的结果(如上方“代码报错截图所示”)
所使用的系统:Ubuntu22.04.4-desktop
所使用的python环境:miniconda

@nayooooo
Copy link
Author

我在Window10中尝试运行,也是一样的错误

@nayooooo
Copy link
Author

nayooooo commented Apr 19, 2024

我发现问题在于有些课程的margint10没有title属性,因此在执行以下程序时会报错:

_course_detail["desc"] = course.select_one("p.margint10").attrs["title"]

这个属性在后续内容中没有被使用到,因此可以采用异常处理的手段来避免程序中断,修改后的内容如下:

try:
_course_detail["desc"] = course.select_one("p.margint10").attrs["title"]
except:
_course_detail["desc"] = “无”

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