Update Boston Globe

This commit is contained in:
Kovid Goyal 2018-08-07 08:14:59 +05:30
parent 39e41aac6b
commit 7c4b39173b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -16,7 +16,7 @@ class BostonGlobeSubscription(BasicNewsRecipe):
__author__ = 'Rob Freundlich' __author__ = 'Rob Freundlich'
description = 'Boston Globe with full articles for subscribers' description = 'Boston Globe with full articles for subscribers'
language = 'en' language = 'en'
INDEX = 'http://www.bostonglobe.com/todayspaper/%Y/%m/%d' INDEX = 'https://www.bostonglobe.com/todayspaper/%Y/%m/%d'
todaysDate = date.today().strftime("%d/%m/%Y") todaysDate = date.today().strftime("%d/%m/%Y")
timefmt = ' [%a, %d %b, %Y]' timefmt = ' [%a, %d %b, %Y]'
needs_subscription = 'optional' needs_subscription = 'optional'
@ -107,9 +107,9 @@ class BostonGlobeSubscription(BasicNewsRecipe):
for story in stories: for story in stories:
h2 = story.find("h2", {"class": 'story-title'}) h2 = story.find("h2", {"class": 'story-title'})
link = story.find("a", {'class': 'story-perm'}) link = story.find("a", {'class': 'story-perm'})
for img in h2.findAll('img'):
img.extract()
if h2 is not None and link is not None: if h2 is not None and link is not None:
for img in h2.findAll('img'):
img.extract()
title = self.tag_to_string(h2) title = self.tag_to_string(h2)
url = self.absolutize_url(link["href"]) url = self.absolutize_url(link["href"])
excerpt_div = story.find("div", {"class": "excerpt"}) excerpt_div = story.find("div", {"class": "excerpt"})