From 2c8afa639c1cf57febcd655e05a8ef0279dadf1e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Nov 2022 07:56:35 +0530 Subject: [PATCH] Update MIT Technology Review --- recipes/mit_technology_review.recipe | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/recipes/mit_technology_review.recipe b/recipes/mit_technology_review.recipe index 7501ea8955..e749850fad 100644 --- a/recipes/mit_technology_review.recipe +++ b/recipes/mit_technology_review.recipe @@ -43,6 +43,7 @@ class MitTechnologyReview(BasicNewsRecipe): no_stylesheets = True remove_empty_feeds = True remove_attributes = ['height', 'width', 'style', 'padding', 'padding-top'] + delay = 1 masthead_url = 'https://wp-preprod.technologyreview.com/wp-content/uploads/2021/08/Screen-Shot-2021-08-20-at-11.11.12-AM-e1629473232355.png' extra_css = ''' #pub-d{font-size:small;} @@ -69,21 +70,16 @@ class MitTechnologyReview(BasicNewsRecipe): def parse_index(self): soup = self.index_to_soup(self.INDEX) - self.timefmt = ' [{}]'.format( - self.tag_to_string( - soup.find( - attrs={ - 'class': lambda x: x and x.startswith('magazineHero__date') - } - ) - ) - ) + issue = soup.find('h1', attrs={'class':lambda x: x and x.startswith('magazineHero__title')}) + time = soup.find(attrs={'class': lambda x: x and x.startswith('magazineHero__date')}) + self.timefmt = ' (' + self.tag_to_string(issue) + ') [' + self.tag_to_string(time) + ']' + self.log('Downloading issue: ', self.timefmt) # parse articles feeds = OrderedDict() classNamePrefixes = [ - "magazineHero__letter--", "teaserItem__title", "teaserItem--aside__title" + "teaserItem__title", "teaserItem--aside__title" ] for div in soup.findAll( attrs={