-
Notifications
You must be signed in to change notification settings - Fork 107
Add Media Indonesia Publisher #804
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
base: master
Are you sure you want to change the base?
Conversation
addie9800
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding our first Indonesian publisher! I do have a couple of comments, before we can continue with the next step.
|
|
||
|
|
||
| class MediaIndonesiaParser(ParserProxy): | ||
| class V1(BaseParser): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The images attribute seems to be missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topics also seem to be missing. They can be accessed using the meta attribute keywords.
|
|
||
| class MediaIndonesiaParser(ParserProxy): | ||
| class V1(BaseParser): | ||
| _paragraph_selector = CSSSelector("div.article") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph selector selects just the entire article as one big paragraph. You should consider something like div.article > p. Make sure it is consistent with the subheadlines of this article. I would recommend switching to XPaths, I personally prefert them for these more subtle cases.
| class MediaIndonesiaParser(ParserProxy): | ||
| class V1(BaseParser): | ||
| _paragraph_selector = CSSSelector("div.article") | ||
| _subheadline_selector = CSSSelector("div.article > h2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This article uses a different formatting for the subheadlines.
To add Media Indonesia publisher, a new python file is created (media_indonesia.py) for the parser class. Extracted information are title, author, published date, and article.