From e987d8f70c05993884bfbb0ac31958695da456f7 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:33:23 +0530 Subject: [PATCH] Update The Week India --- recipes/the_week.recipe | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/recipes/the_week.recipe b/recipes/the_week.recipe index 3ad11bdaac..793f0089fb 100644 --- a/recipes/the_week.recipe +++ b/recipes/the_week.recipe @@ -1,6 +1,6 @@ from datetime import datetime -from calibre.web.feeds.news import BasicNewsRecipe +from calibre.web.feeds.news import BasicNewsRecipe, classes class TheWeek(BasicNewsRecipe): @@ -17,17 +17,18 @@ class TheWeek(BasicNewsRecipe): remove_attributes = ['style', 'height', 'width'] masthead_url = 'https://www.theweek.in/content/dam/week/logo/The-Week-Logo-Big.png' - keep_only_tags = [ - dict( - name='div', - attrs={ - 'class': [ - 'article-title', 'article-image', 'articlecontentbody section', - 'element11-page-content' - ] - } - ), - ] + keep_only_tags = [classes('article-post section-heading element11-page-content')] + + remove_tags = [classes('article-highlights sharebar')] + + remove_tags_after = [classes('articlecontentbody')] + + extra_css = ''' + img {display:block; margin:0 auto;} + em, blockquote { color: #202020; } + .article-image, .article-imgbox { text-align:center; font-size:small; } + .article-info { font-size:small; } + ''' def get_cover_url(self): soup = self.index_to_soup(