-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
"IndexError: list index out of range" error running coursera-dl #66
Comments
Hi, @alvatarc, I think that we need further information on your environment (as I put on our README recently), since I have no problems here:
|
Hi, Thanks for taking time testing it. Answering to the questions in the README:
I've also tried with previous versions, like: ...no luck! Same errors. I had coursera-dl working a week ago... what other info could I provide you? |
Another course:
|
And another one. They all seem to produce the same failure:
|
Can you save the page that you get? Perhaps adding:
Right after the beginning of function Another try would be to see if you can get git bisect to see which was the first commit that broke things (if this is not dependent on coursera, of course). Another thing that could perhaps be a reason for problems with be diacriticals in your name, but... I also have one in mine (é), which potentially excludes this possibility. Well, unless your system is not configured to work with utf-8 (see the output of Oh, and for the record, I also can download things from gametheory (which means that I don't see the problems that you are reporting a second time):
Honestly, if the points that I raised above don't help, I really don't know what may be happening... The only other thing that I can think of is perhaps some geolocation thing? |
Hi, Thanks a lot for your help.
Could this be an error coming from beautiful soup? |
Found it. It could be a bug coming from Beautiful Soup 4.1.3: When I print vtag.a I see: <a data-lecture-id="19" data-modal=".course-mo" data-modal-iframe="https://class.coursera.org/crypto-005/lecture/view?lecture_id=19" href="https://class.coursera.org/crypto-005/lecture/19"></a> But original web page shows: <a data-lecture-id="19"
data-modal-iframe="https://class.coursera.org/crypto-005/lecture/view?lecture_id=19"
href="https://class.coursera.org/crypto-005/lecture/19"
data-modal=".course-modal-frame"
rel="lecture-link"
class="lecture-link">
Modes of operation: one time key (8 min)</a> You couldn't reproduce it becuase Beautiful Soup 3 doesn't have this problem. In the code: try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup you first try with Beautiful Soup 3, otherwise it imports BS4. This fallback was causing my issue. It will happen to those who don't have Beautiful Soup 3 installed but do have BS4. This took me some time... I don't know much Python. Seems a cute newbie-welcoming language though :) |
Same problem here:
Using Ubuntu 13.04 with python2.7 (Beautiful Soup version is 4.1.2). In other PC with Archlinux (python2.7 and Beautiful Soup 3.2) works OK for the same user and courses. Using the coursera-dl version from commit 942899d PS: Thank you for this useful script! |
Hi. Is this fixed given the pull request in #91? Can we close this bug? |
Yeah, it works like a charm ;) |
@fgsalomon, great. Closing it. |
The following error consistently arises when running the program for several courses:
The text was updated successfully, but these errors were encountered: