From 7be79b4ff802c3ec06ee631b090e41d646a67b9d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Mar 2013 10:04:05 +0530 Subject: [PATCH] Update History Today --- recipes/history_today.recipe | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/history_today.recipe b/recipes/history_today.recipe index 9f88976b66..204e239de3 100644 --- a/recipes/history_today.recipe +++ b/recipes/history_today.recipe @@ -1,6 +1,6 @@ -import re -from calibre.web.feeds.recipes import BasicNewsRecipe from collections import OrderedDict +import re +from calibre.web.feeds.news import BasicNewsRecipe class HistoryToday(BasicNewsRecipe): @@ -19,7 +19,6 @@ class HistoryToday(BasicNewsRecipe): needs_subscription = True - def get_browser(self): br = BasicNewsRecipe.get_browser(self) if self.username is not None and self.password is not None: @@ -46,8 +45,9 @@ class HistoryToday(BasicNewsRecipe): #Go to issue soup = self.index_to_soup('http://www.historytoday.com/contents') - cover = soup.find('div',attrs={'id':'content-area'}).find('img')['src'] + cover = soup.find('div',attrs={'id':'content-area'}).find('img', attrs={'src':re.compile('.*cover.*')})['src'] self.cover_url=cover + self.log(self.cover_url) #Go to the main body @@ -84,4 +84,3 @@ class HistoryToday(BasicNewsRecipe): def cleanup(self): self.browser.open('http://www.historytoday.com/logout') -