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

KeyError:'href' for course einstein-001 #44

Closed indraastra closed 11 years ago

indraastra commented 11 years ago

Hi, I'm seeing the following error:

Course 1 of 5
* Collecting downloadable content from https://class.coursera.org/einstein-001/lecture/index
Traceback (most recent call last):
  File "C:\Python27\Scripts\coursera-dl-script.py", line 8, in <module>
    load_entry_point('coursera-dl==1.4.8', 'console_scripts', 'coursera-dl')()
  File "build\bdist.win32\egg\courseradownloader\courseradownloader.py", line 59
8, in main
  File "build\bdist.win32\egg\courseradownloader\courseradownloader.py", line 30
1, in download_course
  File "build\bdist.win32\egg\courseradownloader\courseradownloader.py", line 19
4, in get_downloadable_content
  File "C:\Python27\lib\site-packages\bs4\element.py", line 879, in __getitem__
    return self.attrs[key]
KeyError: 'href'
rodch-us commented 11 years ago

I have successfully downloaded the contents in this course without any errors. This error maybe due to something at your end, make sure you have accepted honor code before downloading.

indraastra commented 11 years ago

Odd, but very likely. I've downloaded it in the past successfully as well but haven't been able to recently because of that error. Did you mean you downloaded this just before you posted your comment?

I'm running python 2.7.3 from a Windows 7 command prompt.

dgorissen commented 11 years ago

Sorry for the delay in looking at this. Can you just confirm that this problem still occurs with the latest git checkout. If so does switching parsers (e.g., using html5lib instead of lxml) solve the issue? (see the -q option)