Skip to content

fix: safe access to href attribute in news extractor#154

Open
shivv23 wants to merge 1 commit into
c2siorg:mainfrom
shivv23:fix/safe-extractor-link-access
Open

fix: safe access to href attribute in news extractor#154
shivv23 wants to merge 1 commit into
c2siorg:mainfrom
shivv23:fix/safe-extractor-link-access

Conversation

@shivv23

@shivv23 shivv23 commented Mar 23, 2026

Copy link
Copy Markdown

Description

Use .get() to safely access href attribute, preventing KeyError when href is missing from link elements.

Related Issues

Motivation and Context

Some news sources may not have href attributes on all link elements. This change prevents crashes on such cases.

How Has This Been Tested

  • Syntax verification passed
  • Minimal change (1 line)

Checklist

  • My code follows the code style of this project
  • I have read the CONTRIBUTING document

Use .get() to safely access href attribute, preventing KeyError
when href is missing from link elements.

Closes c2siorg#120
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.

1 participant