diff --git a/recipes/wsj_free.recipe b/recipes/wsj_free.recipe index 419ddacaae..ff565b5dc2 100644 --- a/recipes/wsj_free.recipe +++ b/recipes/wsj_free.recipe @@ -10,6 +10,7 @@ from base64 import standard_b64encode from datetime import date, timedelta from mechanize import Request +from calibre.ptempfile import PersistentTemporaryFile from calibre.web.feeds.news import BasicNewsRecipe from css_selectors import Select @@ -22,12 +23,9 @@ try: except ImportError: from urllib import quote -from calibre.scraper.simple import read_url -from calibre.ptempfile import PersistentTemporaryFile needs_subscription = False - class WSJ(BasicNewsRecipe): if needs_subscription: @@ -52,7 +50,7 @@ class WSJ(BasicNewsRecipe): extra_css = ''' #big-top-caption { font-size:small; text-align:center; } - [data-type:"tagline"] { font-style:italic; color:#202020; } + [data-type:"tagline"], em { font-style:italic; color:#202020; } .auth { font-size:small; } .sub, em, i { color: #202020; } ''' @@ -75,6 +73,7 @@ class WSJ(BasicNewsRecipe): articles_are_obfuscated = True def get_obfuscated_article(self, url): + from calibre.scraper.simple import read_url br = self.get_browser() br.set_handle_redirect(False) try: @@ -116,7 +115,6 @@ class WSJ(BasicNewsRecipe): parent['class'] = 'auth' return soup - # login {{{ def get_browser_for_wsj(self, *a, **kw): @@ -126,7 +124,7 @@ class WSJ(BasicNewsRecipe): br.set_cookie('ccpaApplies', 'false', '.wsj.com') return br - if needs_subscription: + if False and needs_subscription: # disabled as we currently use archive.is def get_browser(self, *a, **kw): from pprint import pprint pprint