Skip to content
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

Merged
merged 7 commits into from
Feb 7, 2024
Merged

Update Bild Sources, Update SZ Parser #352

merged 7 commits into from
Feb 7, 2024

Conversation

addie9800
Copy link
Collaborator

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)

@addie9800 addie9800 linked an issue Feb 5, 2024 that may be closed by this pull request
Copy link
Collaborator

@MaxDall MaxDall left a 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.

Comment on lines 22 to 25
_subheadline_selector = XPath(
"//div[@itemprop='articleBody']//h3[@data-manual='subheadline']|"
"//div[@itemprop='articleBody']//h2[@data-manual='subheadline']"
)
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

@addie9800 addie9800 requested a review from MaxDall February 6, 2024 20:49
@addie9800 addie9800 merged commit ce6039d into master Feb 7, 2024
5 checks passed
@addie9800 addie9800 deleted the update_SZ branch February 7, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: SZ Parser is not up to date
2 participants