Fix #1419612 [Fetch News: 'NoneType' object has no attribute 'extract'](https://bugs.launchpad.net/calibre/+bug/1419612)

This commit is contained in:
Kovid Goyal 2015-02-09 11:47:27 +05:30
parent df780dd8e0
commit 90f749533f

View File

@ -39,7 +39,10 @@ class TheHindu(BasicNewsRecipe):
current_articles = [] current_articles = []
div = soup.find('div', attrs={'id': 'left-column'}) 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() soup.find('div', attrs={'id': 'tpnav-bar'}).extract()
for x in div.findAll(['a']): for x in div.findAll(['a']):