Fix cover download for WSJ subscriber recipe

This commit is contained in:
Kovid Goyal 2018-09-17 18:44:03 +05:30
parent 0c923d9a4f
commit 50adaa402c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -98,19 +98,12 @@ class WSJ(BasicNewsRecipe):
return soup return soup
def get_cover_url(self): def get_cover_url(self):
cover = 'https://vir.wsj.net/fp/cdn/fp/assets/images/WSJ_A1.jpg' index = 'http://en.kiosko.net/us/np/wsj.html'
br = BasicNewsRecipe.get_browser(self) soup = self.index_to_soup(index)
try: for image in soup.findAll('img', src=True):
br.open(cover) if image['src'].endswith('750.jpg'):
except: return image['src']
index = 'http://en.kiosko.net/us/np/wsj.html' self.log("\nCover unavailable")
soup = self.index_to_soup(index)
for image in soup.findAll('img', src=True):
if image['src'].endswith('750.jpg'):
return image['src']
self.log("\nCover unavailable")
cover = None
return cover
def get_browser(self): def get_browser(self):
# To understand the signin logic read signin.js from # To understand the signin logic read signin.js from