From 190126c35eed00c43d6d5c5c80f9d7cf97f64766 Mon Sep 17 00:00:00 2001 From: "Christopher J. Pilkington" Date: Wed, 29 Jul 2015 00:41:58 -0400 Subject: [PATCH] Only injest A tags from DIV ID middleContainer. --- recipes/xkcd.recipe | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/xkcd.recipe b/recipes/xkcd.recipe index 2aa704992e..d10e5dbee8 100644 --- a/recipes/xkcd.recipe +++ b/recipes/xkcd.recipe @@ -2,6 +2,8 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' ''' Changelog: +2015-07-29 +Fixed issue with 'a' tags outside of list of articles (cjp) 2012-04-06 Fixed empty articles, added masthead img (NiLuJe) 2011-09-24 @@ -39,7 +41,7 @@ class XkcdCom(BasicNewsRecipe): soup = self.index_to_soup(INDEX) articles = [] - for item in soup.findAll('a', title=True): + for item in soup.find('div', attrs={'id': 'middleContainer'}).findAll('a', title=True): articles.append({ 'date': item['title'], 'timestamp': time.mktime(time.strptime(item['title'], '%Y-%m-%d'))+1,