Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Oct 2, 2024
2 parents f5fd9f8 + 6a082bb commit b77b2e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion recipes/natgeomag.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class NatGeo(BasicNewsRecipe):
articles = ans.setdefault(section, [])
articles.append({'title': title, 'url': url})
for promo in soup.findAll(**classes('OneUpPromoCard__Content')):
if promo.find('a', attrs={'href': True}):
if promo.find('a', attrs={'href': True}) and promo.a.get('href'):
url = promo.a['href']
section = self.tag_to_string(promo.find(**classes('SectionLabel')))
title = self.tag_to_string(promo.find(**classes('Card__Content__Heading')))
Expand Down

0 comments on commit b77b2e3

Please sign in to comment.