diff --git a/recipes/nytimes.recipe b/recipes/nytimes.recipe index f9796a23b6..a6b38d082e 100644 --- a/recipes/nytimes.recipe +++ b/recipes/nytimes.recipe @@ -96,7 +96,7 @@ class NewYorkTimes(BasicNewsRecipe): def preprocess_html(self, soup): article = soup.find(id='story') # The NYT is apparently A/B testing a new page layout - has_supplemental = article.find(**classes('story-body-supplemental')) is not None + has_supplemental = article is not None and article.find(**classes('story-body-supplemental')) is not None if has_supplemental: keep_only_tags = [ dict(id='story-header'), diff --git a/recipes/nytimes_sub.recipe b/recipes/nytimes_sub.recipe index a309e98880..d2cbf8d583 100644 --- a/recipes/nytimes_sub.recipe +++ b/recipes/nytimes_sub.recipe @@ -96,7 +96,7 @@ class NewYorkTimes(BasicNewsRecipe): def preprocess_html(self, soup): article = soup.find(id='story') # The NYT is apparently A/B testing a new page layout - has_supplemental = article.find(**classes('story-body-supplemental')) is not None + has_supplemental = article is not None and article.find(**classes('story-body-supplemental')) is not None if has_supplemental: keep_only_tags = [ dict(id='story-header'),