Skip to content

Conversation

@rekordii
Copy link

Please review if you have time. Needs to be merged after SE Expressen (#800)

Copy link
Collaborator

@addie9800 addie9800 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 adding our now second Swedish publisher. I only have a couple of remarks before we can go ahead.

)


class AftonbladetParser(ParserProxy):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're a bit in a special situation here. It seems as if the publisher did not implement the isAccessibleForFree attribute here, which is the default handling of the free_access attribute. You would need to find a custom implementation for this publisher. Example: https://www.aftonbladet.se/bil/a/bmRM95/privatleasade-audi-som-gick-sonder-far-betala-manadsavgift, this article is marked as free to access.


@attribute
def images(self) -> List[Image]:
return image_extraction(doc=self.precomputed.doc, paragraph_selector=self._paragraph_selector)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_summary_selector = XPath("//p[contains(@data-test-tag,'lead-text')]")
_paragraph_selector = XPath(
"//p[starts-with(@class,'hyperion-css-') and not(contains(@data-test-tag,'lead-text'))]"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class AftonbladetParser(ParserProxy):
class V1(BaseParser):
_summary_selector = XPath("//p[contains(@data-test-tag,'lead-text')]")
_paragraph_selector = XPath(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addie9800 addie9800 self-assigned this Oct 26, 2025
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.

2 participants