From 159d081456fdcc1d77acf610e964338532ff250d Mon Sep 17 00:00:00 2001 From: Gary Arnold Date: Mon, 5 Mar 2018 14:55:46 -0800 Subject: [PATCH] ga - Corrects more parsing edge cases (issue 136) --- recipes/granta.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/granta.recipe b/recipes/granta.recipe index af64509fb7..a278ef9e8f 100644 --- a/recipes/granta.recipe +++ b/recipes/granta.recipe @@ -259,14 +259,14 @@ class Granta(BasicNewsRecipe): h2 = toc.find('h2') if h1.find('a') is not None and h1.find('a').contents is not None: title = h1.find('a').contents[0].strip() - elif h1.contents[0] is not None: + elif len(h1.contents) > 0 and h1.contents[0] is not None: title = h1.contents[0] else: title = '' if h2.find('a') is not None and h2.find('a').contents is not None: author = h2.find('a').contents[0].strip() title = title + u' (%s)' % author - elif h2.contents[0] is not None: + elif len(h2.contents) > 0 and h2.contents[0] is not None: author = h2.contents[0] title = title + u' (%s)' % author else: