From 90f749533ff1be4e556ab9bdb83f3de5dbd85a01 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Feb 2015 11:47:27 +0530 Subject: [PATCH] Fix #1419612 [Fetch News: 'NoneType' object has no attribute 'extract'](https://bugs.launchpad.net/calibre/+bug/1419612) --- recipes/hindu.recipe | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/hindu.recipe b/recipes/hindu.recipe index c180a3b7fd..d7f69b37dc 100644 --- a/recipes/hindu.recipe +++ b/recipes/hindu.recipe @@ -39,7 +39,10 @@ class TheHindu(BasicNewsRecipe): current_articles = [] div = soup.find('div', attrs={'id': 'left-column'}) - soup.find('span', attrs={'class': 'newsection-title'}).extract() + try: + soup.find('span', attrs={'class': 'newsection-title'}).extract() + except AttributeError: + continue # empty section soup.find('div', attrs={'id': 'tpnav-bar'}).extract() for x in div.findAll(['a']):