Update New York Times

This commit is contained in:
Kovid Goyal 2018-08-01 03:31:11 +05:30
parent ded06e6b00
commit bab192fa6c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 6 deletions

View File

@ -219,9 +219,10 @@ class NewYorkTimes(BasicNewsRecipe):
container = soup.find(itemtype='http://schema.org/CollectionPage')
highlights = container.find('section', **classes('highlights'))
for article in self.parse_highlights(highlights):
log(article)
yield article
if highlights is not None:
for article in self.parse_highlights(highlights):
log(article)
yield article
extra = container.find('section', attrs={'data-collection-type': True})
if extra is not None:
title = self.tag_to_string(extra.find('h2'))

View File

@ -219,9 +219,10 @@ class NewYorkTimes(BasicNewsRecipe):
container = soup.find(itemtype='http://schema.org/CollectionPage')
highlights = container.find('section', **classes('highlights'))
for article in self.parse_highlights(highlights):
log(article)
yield article
if highlights is not None:
for article in self.parse_highlights(highlights):
log(article)
yield article
extra = container.find('section', attrs={'data-collection-type': True})
if extra is not None:
title = self.tag_to_string(extra.find('h2'))