Update Indian Express

This commit is contained in:
Kovid Goyal 2022-08-18 17:47:51 +05:30
parent 8d091a26c1
commit 7fdf70f733
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -25,6 +25,8 @@ class IndianExpress(BasicNewsRecipe):
#storycenterbyline {font-size:small;} #storycenterbyline {font-size:small;}
#img-cap {font-size:small;} #img-cap {font-size:small;}
blockquote{text-align:center; color:#404040;} blockquote{text-align:center; color:#404040;}
em{font-style:italic; color:#808080;}
#sub-d{color:#202020; font-style:italic;}
''' '''
resolve_internal_links = True resolve_internal_links = True
remove_empty_feeds = True remove_empty_feeds = True
@ -64,7 +66,7 @@ class IndianExpress(BasicNewsRecipe):
classes( classes(
'share-social appstext ie-int-campign-ad ie-breadcrumb custom_read_button unitimg copyright' 'share-social appstext ie-int-campign-ad ie-breadcrumb custom_read_button unitimg copyright'
' storytags pdsc-related-modify news-guard premium-story append_social_share' ' storytags pdsc-related-modify news-guard premium-story append_social_share'
' digital-subscriber-only h-text-widget ie-premium ie-first-publish adboxtop adsizes' ' digital-subscriber-only h-text-widget ie-premium ie-first-publish adboxtop adsizes related-widget immigrationimg'
) )
] ]
@ -107,9 +109,12 @@ class IndianExpress(BasicNewsRecipe):
return citem['content'] return citem['content']
def preprocess_html(self, soup): def preprocess_html(self, soup):
h2 = soup.findAll('h2') h1 = soup.find('h1')
for sub in h2: if h1:
sub.name = 'h5' h2 = h1.findNext('h2')
if h2:
h2.name = 'p'
h2['id'] = 'sub-d'
for span in soup.findAll( for span in soup.findAll(
'span', attrs={'class': ['ie-custom-caption', 'custom-caption']} 'span', attrs={'class': ['ie-custom-caption', 'custom-caption']}
): ):