From 766a7faeb6472234aa8023613218bfbce038aa4e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 21 May 2018 21:30:47 +0530 Subject: [PATCH] ... --- recipes/nytimes.recipe | 2 +- recipes/nytimes_sub.recipe | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'),