Update Strategy+Business

Fixes #1367347 [Private bug](https://bugs.launchpad.net/calibre/+bug/1367347)
This commit is contained in:
Kovid Goyal 2014-09-10 09:12:20 +05:30
parent 27a21b00d1
commit 1c65579a5d

View File

@ -33,11 +33,10 @@ class StrategyBusinessRecipe(BasicNewsRecipe):
elif c.name.endswith('_password'):
br[c.name] = self.password
raw = br.submit().read()
if 'You have been logged in' not in raw:
if '>Logout<' not in raw:
raise ValueError('Failed to login, check your username and password')
return br
extra_css = '''
body{font-family:verdana,arial,helvetica,geneva,sans-serif ;}
a {text-decoration: none; color: blue;}
@ -68,16 +67,16 @@ class StrategyBusinessRecipe(BasicNewsRecipe):
feeds.append((u'Business Literature', u'http://feeds.feedburner.com/StrategyBusiness-BusinessLiterature?format=xml'))
feeds.append((u'Recent Research', u'http://feeds.feedburner.com/StrategyBusiness-RecentResearch?format=xml'))
keep_only_tags = []
keep_only_tags.append(dict(name='div', attrs={'id': 'sb-column2'}))
remove_tags = []
remove_tags.append(dict(name='img', attrs={'class': 'content1'}))
remove_tags.append(dict(name='img', attrs={'src': '/media/image/end_of_story.gif'}))
remove_tags.append(dict(name = 'div', attrs = {'class': 'sb-adarea468'}))
remove_tags.append(dict(name='div', attrs={'class': ['sb-adarea468', 'GigyaShare', 'moreBlogLinks', 'clearboth', 'GigyaCommentsContainer']}))
remove_tags.append(dict(name='div', attrs={'id': 'sb-paging'}))
remove_tags.append(dict(name='div', attrs={'id': 'textsize'}))
remove_tags.append(dict(name='div', id=lambda x:x and x.startswith('div-gpt-ad-')))
def print_version(self, url):
return url + '?pg=all'
return url.partition('?')[0] + '?pg=all'