Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

AttributeError: 'NoneType' object has no attribute 'find_all' #10

Closed
whitepoplars opened this issue Aug 10, 2018 · 3 comments
Closed

AttributeError: 'NoneType' object has no attribute 'find_all' #10

whitepoplars opened this issue Aug 10, 2018 · 3 comments

Comments

@whitepoplars
Copy link

(错误简述)

网站:学堂在线

课程地址:学堂在线好几个课程都这样

问题描述:

python mooc.py http://www.xuetangx.com/courses/course-v1:TsinghuaX+30670043X+sp/about
验证成功!

传播学原理(自主模式) - 清华大学
正在获取电子书……
Traceback (most recent call last):
File "mooc.py", line 64, in
main()
File "mooc.py", line 46, in main
xuetangx.start(args.url, args.d, not args.no_pdf, cookies)
File "D:\learn\course-crawler\xuetangx.py", line 234, in start
get_content(courseware)
File "D:\learn\course-crawler\xuetangx.py", line 75, in get_content
chapters = soup.find(id='accordion').find_all(class_='chapter')
AttributeError: 'NoneType' object has no attribute 'find_all'

@Foair
Copy link
Owner

Foair commented Aug 11, 2018

🍻 在·学堂在线·页面点选「免费加入课程」,然后才能使用的哟!

@whitepoplars
Copy link
Author

了然了

@allbluelai
Copy link

网站:学堂在线

课程地址:http://www.xuetangx.com/courses/course-v1:TsinghuaX+00740043_2x_2015_T2+sp/about

问题描述:
python mooc.py http://www.xuetangx.com/courses/course-v1:TsinghuaX+00740043_2x_2015_T2+sp/about

验证成功!
C++语言程序设计进阶 (自主模式) - 清华大学
------> 第1章 绪论
------> 第2章C++简单程序设计
------> 第3章 函数
------> 第4章 类与对象
------> 第5章 数据的共享与保护
------> 第6章 数组、指针与字符串
------> 第7章 继承与派生
------> 第8章 多态性
------> 第9章 群体类和群体数据的组织
------> 第10章 泛型程序设计与C++标准模板库
------> 第11章 流类库与输入/输出
------> 第12章 异常处理
------> 课程介绍与评分标准
------> 学习要求与建议
Traceback (most recent call last):
File "mooc.py", line 87, in
main()
File "mooc.py", line 66, in main
xuetangx.start(args.url, config, cookies)
File "D:\Documents\PycharmProject\course-crawler-master\mooc\xuetangx.py", line 210, in start
get_content(courseware)
File "D:\Documents\PycharmProject\course-crawler-master\mooc\xuetangx.py", line 70, in get_content
chapters = soup.find(id='accordion').find_all(class_='chapter')
AttributeError: 'NoneType' object has no attribute 'find_all'

我已经加入了免费学习,结果也是这样, @Foair

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants