diff --git a/recipes/nytimes.recipe b/recipes/nytimes.recipe index 2bf7d6e1b1..6af8e1188d 100644 --- a/recipes/nytimes.recipe +++ b/recipes/nytimes.recipe @@ -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')) diff --git a/recipes/nytimes_sub.recipe b/recipes/nytimes_sub.recipe index bd49939ac7..99decdce12 100644 --- a/recipes/nytimes_sub.recipe +++ b/recipes/nytimes_sub.recipe @@ -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'))