dgorissen / coursera-dl

A script for downloading course material (video's, pdfs, quizzes, etc) from coursera.org
http://dirkgorissen.com/2012/09/07/coursera-dl-a-coursera-download-script/
GNU General Public License v3.0
1.74k stars 300 forks source link

Cannot download course due to AttributeError #58

Closed kurthuwig closed 11 years ago

kurthuwig commented 11 years ago
Coursera-dl v1.4.8 (lxml)
Logging in as 'coursera.kurt@huwig.de'...

Course 1 of 1
* Collecting downloadable content from https://class.coursera.org/datasci-001/lecture/index
Traceback (most recent call last):
  File "/usr/local/bin/coursera-dl", line 9, in 
    load_entry_point('coursera-dl==1.4.8', 'console_scripts', 'coursera-dl')()
  File "/usr/local/lib/python2.7/dist-packages/courseradownloader/courseradownloader.py", line 598, in main
    d.download_course(cn,dest_dir=args.dest_dir,reverse_sections=args.reverse)
  File "/usr/local/lib/python2.7/dist-packages/courseradownloader/courseradownloader.py", line 301, in download_course
    (weeklyTopics, allClasses) = self.get_downloadable_content(course_url)
  File "/usr/local/lib/python2.7/dist-packages/courseradownloader/courseradownloader.py", line 186, in get_downloadable_content
    hrefs = classResources.findAll('a')
AttributeError: 'NoneType' object has no attribute 'findAll'
dgorissen commented 11 years ago

This works for me. Ensure you are using the latest version and also try an alternative parser (e.g., html.parser).

kurthuwig commented 11 years ago

Thank you, the option "-p html.parser" did the trick. Is there a reason that it is not the default?

hknust commented 11 years ago

Thanks, I had the same issue. The option is -q html.parser, though.

dgorissen commented 11 years ago

html.parser now the default.