-
Notifications
You must be signed in to change notification settings - Fork 83
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
Update Bild Sources, Update SZ Parser #352
Conversation
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 updating both Bild and SZ 👍. For the future it might me good to separate PRs like this with independent changes so that the debate on one addition does not block the other. In this case Bild
would be an easy merge.
src/fundus/publishers/de/sz.py
Outdated
_subheadline_selector = XPath( | ||
"//div[@itemprop='articleBody']//h3[@data-manual='subheadline']|" | ||
"//div[@itemprop='articleBody']//h2[@data-manual='subheadline']" | ||
) |
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.
Normally h2
is reserved for titles so that seems a bit odd to me. Could you explain the reasoning why using both?
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.
I added it for backwards compatibility. But that was based on the thought that older articles might also be parsed by accessing the url. When I looked though older articles I found at least a case or two where the subheadings used h2 and I thought it couldn't hurt to add that to the selectors as well
I found a SiteMap and NewsMap for Bild, so I decided to add that.
I have also fixed the paragraph and subheadline selectors for SZ. I have not created a new parser class for this, since SZ has seemed to have updated their UI entirely and the selectors work (at least as well as the old ones) on all available articles (e.g. https://www.sueddeutsche.de/politik/bundesrat-union-sperrt-sich-gegen-neue-handwerksordnung-1.309844 from 2003)