mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #4945 (Strategy+Business requires login)
This commit is contained in:
parent
6224d7a373
commit
20070a3396
@ -9,16 +9,35 @@ class StrategyBusinessRecipe(BasicNewsRecipe):
|
|||||||
title = u'Strategy+Business'
|
title = u'Strategy+Business'
|
||||||
publisher = u' Booz & Company'
|
publisher = u' Booz & Company'
|
||||||
category = u'Business'
|
category = u'Business'
|
||||||
description = u'Business magazine for senior business executives and the people who influence them.'
|
description = (u'Business magazine for senior business executives and the people who influence them.'
|
||||||
|
'Go to http://www.strategy-business.com/registration to sign up for a free account')
|
||||||
|
|
||||||
oldest_article = 13 * 7 # 3 months
|
oldest_article = 13 * 7 # 3 months
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
|
needs_subscription = True
|
||||||
|
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
|
|
||||||
|
def get_browser(self):
|
||||||
|
br = BasicNewsRecipe.get_browser(self)
|
||||||
|
br.open('http://www.strategy-business.com/registration')
|
||||||
|
for i, f in enumerate(br.forms()):
|
||||||
|
if 'gatekeeper_edit' in f.name:
|
||||||
|
br.select_form(name=f.name)
|
||||||
|
for c in f.controls:
|
||||||
|
if c.name.endswith('_email'):
|
||||||
|
br[c.name] = self.username
|
||||||
|
elif c.name.endswith('_password'):
|
||||||
|
br[c.name] = self.password
|
||||||
|
raw = br.submit().read()
|
||||||
|
if '>Logout' not in raw:
|
||||||
|
raise ValueError('Failed to login, check your username and password')
|
||||||
|
return br
|
||||||
|
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
body{font-family:verdana,arial,helvetica,geneva,sans-serif ;}
|
body{font-family:verdana,arial,helvetica,geneva,sans-serif ;}
|
||||||
a {text-decoration: none; color: blue;}
|
a {text-decoration: none; color: blue;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user