From 4a5dcef8050f27f740037540127268e9835f2972 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 28 Nov 2018 20:17:38 +0530 Subject: [PATCH] Add a retry for WSJ articles --- recipes/wsj.recipe | 3 +++ recipes/wsj_free.recipe | 3 +++ 2 files changed, 6 insertions(+) diff --git a/recipes/wsj.recipe b/recipes/wsj.recipe index 2958a8f9a7..13ec7e607c 100644 --- a/recipes/wsj.recipe +++ b/recipes/wsj.recipe @@ -201,6 +201,9 @@ class WSJ(BasicNewsRecipe): self.log('Found section:', title, '[' + url + ']') try: articles = self.wsj_find_articles(url) + if not articles: + # retry once, sometimes these pages come up empty + articles = self.wsj_find_articles(url) except Exception: self.log.exception('Failed to parse section:', title) articles = [] diff --git a/recipes/wsj_free.recipe b/recipes/wsj_free.recipe index 56a0c65707..d521ebd7a7 100644 --- a/recipes/wsj_free.recipe +++ b/recipes/wsj_free.recipe @@ -201,6 +201,9 @@ class WSJ(BasicNewsRecipe): self.log('Found section:', title, '[' + url + ']') try: articles = self.wsj_find_articles(url) + if not articles: + # retry once, sometimes these pages come up empty + articles = self.wsj_find_articles(url) except Exception: self.log.exception('Failed to parse section:', title) articles = []