diff --git a/recipes/wsj.recipe b/recipes/wsj.recipe index 23c2ca9be5..c3313516c0 100644 --- a/recipes/wsj.recipe +++ b/recipes/wsj.recipe @@ -92,7 +92,9 @@ class WSJ(BasicNewsRecipe): try: br.open(url) except Exception as e: - url = e.hdrs.get('location') + hdrs_location = e.hdrs.get('location') + if hdrs_location: + url = e.hdrs.get('location') raw = read_url(self.storage, 'https://archive.is/latest/' + url) pt = PersistentTemporaryFile('.html') pt.write(raw.encode('utf-8'))