Add a retry for WSJ articles

This commit is contained in:
Kovid Goyal 2018-11-28 20:17:38 +05:30
parent ccc4a17060
commit 4a5dcef805
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -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 = []

View File

@ -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 = []