small changes to parsing.py to address issue #559#564
Open
mor3dr3ad wants to merge 2 commits intocoursera-dl:masterfrom
Open
small changes to parsing.py to address issue #559#564mor3dr3ad wants to merge 2 commits intocoursera-dl:masterfrom
mor3dr3ad wants to merge 2 commits intocoursera-dl:masterfrom
Conversation
Updated parsing on lines 385 and 397 to account for a slightly changed structure in edx's website. Sections can now have one of two classes: `outline-item section` or `outline-item section scored`. Changed code for subsections accordingly too.
recently edx slightly changed their website's structure for some courses: - sections now have one of two classes: `outline-item section` or `outline-item section scored` - subsections have one of two classes: `vertical outline-item focusable` or `vertical outline-item focusable scored`. this resulted in 0 downloadable sections being found for some courses, e.g. https://courses.edx.org/courses/course-v1:MITx+14.750x+3T2019/course/. A slight change in edx_dl/parsing.py in the class NewEdxPageExtractor resolves the issue. Class identifier has been replaced with a list representing both possibilities. This should therefore work for both new and old courses as well as mixed instances.
|
I'm just a random user of edx-dl, but I wanted to say that I tested this change on 2 non-free courses that I'm taking and it works for me. One course recently had the The other course has always been I really appreciate your contribution! I didn't realize it was such a simple change that caused the parser to fail. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚨Please review the guidelines for contributing to this repository.
Proposed changes
Update of edx_dl/parsing.py to account for new edx structure. Class of sections and subsections has been changed. A change in parsing.py lines 385 and 397 fixes the issue.
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.
Further comments
If this is a relatively large or complex change, please explain why you chose
the solution you did and what alternatives you considered, etc.
Reviewers
@rbrito