Chillee / coursera-dl-all

MIT License
189 stars 54 forks source link

Index out of Range error -- Platform: {Windows7, Python 2.7, PhantomJS} Course:{compilers-004} #6

Closed qroshan closed 8 years ago

qroshan commented 8 years ago

Traceback (most recent call last): File "c:\0\Google\projects\coursera-dl-all\dl_all.py", line 299, in download_all_quizzes(session, quiz_info, i[1]) File "c:\0\Google\projects\coursera-dl-all\dl_all.py", line 189, in download_all_quizzes download_quiz(session, quiz_obj, clean_filename(category_name)) File "c:\0\Google\projects\coursera-dl-all\dl_all.py", line 179, in download_quiz session.find_elements_by_css_selector('#spark > form > p > input')[0].click() IndexError: list index out of range

Chillee commented 8 years ago

Ah. What happened here was that the midterm is inaccessible if you've already accessed the page before, and the program always assumes that you can go to a quiz if there's a link.

I've added a try/catch block for that case.