-
Notifications
You must be signed in to change notification settings - Fork 639
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
TypeError: 'NoneType' object is not subscriptable #595
Comments
This also happens with https://courses.edx.org/courses/course-v1:GTx+HI2018xII+1T2019/course/ |
I get this fixed by changing line 372 code in parsing.py. |
aprilchew: Tried it, doesn't work. |
Try section_soup.ol, remove the ['href'] |
@aprilchew Thank you very much. It does indeed fix the issue. For those who are still having trouble, here are the steps that you can follow.
Here is the before and after Image for reference
NOTE: If you have downloaded edx-dl using pip, the following steps won't work. To make it work you need to navigate to site-packages or dist-packages folder, find the edx-dl folder, look for parser.py and make the necessary changes as above. EDIT: I've downloaded a few other courses as well, and this change has not yet broken any other downloads so far. |
Hi, A PR would be appreciated :) Kind regards |
Tigerjoy solution worked for me. However, be careful and not create another line, I just replaced the original code. |
Hello smart guys. is there no one available in github who is able to fix the problems of downloading tutorials sucessfully from Edx website?. I have tried since 2019 to use this script to download my tutorials from Edx and it only stops after displaying my course contains. For me its really a pain because i have courses i desperately needed offline which have expired and i am still learning to code and not experiened to help in solving the downloading problems. Thanks |
I can work on it, will send a pr soon. |
@Ankk98, a pull request that closes this would be welcome. Again: the simpler (and cleaner) the code, the better (since it will ease maintenance in the future when things break again--and they will). |
@Ankk98 |
Hi, I faced to the issue on a course today. So I decided to do a PR... Here is the PR on the table. Anyone know who are the owner(s) of this project? If anyone can help here it will nice :) Thanks |
Hi, |
For those who are still having trouble, here are the steps that you can follow.
Here is the before and after Image for reference
NOTE: If you have downloaded edx-dl using pip, the following steps won't work. To make it work you need to navigate to site-packages or dist-packages folder, find the edx-dl folder, look for parser.py and make the necessary changes as above. EDIT: I've downloaded a few other courses as well, and this change has not yet broken any other downloads so far.Hi, |
Subject of the issue
when trying to download the course videos specifically one course (listed bellow), it gives the error TypeError: 'NoneType' object is not subscriptable.
Tried with others and doesn't give errors and works fine.
Traceback (most recent call last):
File "/usr/local/bin/edx-dl", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/edx_dl/edx_dl.py", line 1023, in main
for selected_course in selected_courses}
File "/usr/local/lib/python3.6/dist-packages/edx_dl/edx_dl.py", line 1023, in
for selected_course in selected_courses}
File "/usr/local/lib/python3.6/dist-packages/edx_dl/edx_dl.py", line 186, in get_available_sections
sections = page_extractor.extract_sections_from_html(page, BASE_URL)
File "/usr/local/lib/python3.6/dist-packages/edx_dl/parsing.py", line 403, in extract_sections_from_html
for i, section_soup in enumerate(sections_soup, 1)]
File "/usr/local/lib/python3.6/dist-packages/edx_dl/parsing.py", line 403, in
for i, section_soup in enumerate(sections_soup, 1)]
File "/usr/local/lib/python3.6/dist-packages/edx_dl/parsing.py", line 372, in _make_url
return section_soup.a['href']
environment
Steps to reproduce
https://courses.edx.org/courses/course-v1:IBM+PY0101EN+1T2020/cou
rse/
The text was updated successfully, but these errors were encountered: