This commit is contained in:
Kovid Goyal 2024-10-01 21:57:34 +05:30
commit f5fd9f871b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -208,11 +208,12 @@ class NatGeo(BasicNewsRecipe):
articles = ans.setdefault(section, []) articles = ans.setdefault(section, [])
articles.append({'title': title, 'url': url}) articles.append({'title': title, 'url': url})
for promo in soup.findAll(**classes('OneUpPromoCard__Content')): for promo in soup.findAll(**classes('OneUpPromoCard__Content')):
url = promo.a['href'] if promo.find('a', attrs={'href': True}):
section = self.tag_to_string(promo.find(**classes('SectionLabel'))) url = promo.a['href']
title = self.tag_to_string(promo.find(**classes('Card__Content__Heading'))) section = self.tag_to_string(promo.find(**classes('SectionLabel')))
articles = ans.setdefault(section, []) title = self.tag_to_string(promo.find(**classes('Card__Content__Heading')))
articles.append({'title': title, 'url': url}) articles = ans.setdefault(section, [])
articles.append({'title': title, 'url': url})
for gird in soup.findAll(attrs={'class':'GridPromoTile'}): for gird in soup.findAll(attrs={'class':'GridPromoTile'}):
for article in soup.findAll('article'): for article in soup.findAll('article'):
a = article.find('a') a = article.find('a')