Fix Business Today Magazine

This commit is contained in:
unkn0w7n 2023-08-06 12:15:24 +05:30
parent ffd1af3ddb
commit 57bd5e66a0
3 changed files with 8 additions and 9 deletions

View File

@ -60,13 +60,14 @@ class Bloomberg(BasicNewsRecipe):
extra_css = '''
.auth {font-size:small; font-weight:bold;}
.time, .chart {font-size:small;}
.subhead {font-style:italic; color:#404040;}
.subhead, blockquote {font-style:italic; color:#404040;}
.cat {font-size:small; color:gray;}
.news-figure-caption-text, .cap, .img {font-size:small; text-align:center;}
.news-figure-credit {font-size:small; text-align:center; color:#202020;}
'''
articles_are_obfuscated = True
resolve_internal_links = True
def get_obfuscated_article(self, url):
br = self.get_browser()

View File

@ -16,9 +16,7 @@ class BT(BasicNewsRecipe):
masthead_url = 'https://akm-img-a-in.tosshub.com/businesstoday/resource/img/logo.png'
keep_only_tags = [
dict(name='h1'),
dict(name='h2'),
classes('brand-detial-main main-img story-with-main-sec'),
classes('story-heading sab-head-tranlate-sec user-detial-left main-img field--name-body'),
]
remove_tags = [
dict(name='a', attrs={'title': 'videos'}),
@ -28,11 +26,11 @@ class BT(BasicNewsRecipe):
def parse_index(self):
soup = self.index_to_soup('https://www.businesstoday.in/magazine')
issue = soup.find(attrs={'class': 'view-id-latest_issue_magzine'})
a = issue.findAll('a', href=lambda x: x and x.startswith('/magazine/issue/'))[1]
issue = soup.find(attrs={'class': 'swiper-wrapper'})
a = issue.findAll('a', href=lambda x: x and '/magazine/issue/' in x)[1]
url = a['href']
self.log('issue =', url)
soup = self.index_to_soup('https://www.businesstoday.in' + url)
soup = self.index_to_soup(url)
tag = soup.find(attrs={'class': 'issue-image'})
if tag:
self.cover_url = tag.find('img')['src']
@ -62,7 +60,7 @@ class BT(BasicNewsRecipe):
# Insert feeds in specified order, if available
feedSort = ['Editors Note']
feedSort = ['Editor\'s Note']
for i in feedSort:
if i in sections:
feeds.append((i, sections[i]))

View File

@ -38,7 +38,7 @@ class IndiaToday(BasicNewsRecipe):
'''
remove_tags = [
classes('checkout__section sharing align-center-button amp-izooto-sub ads__container inline-story-add amp-ad'),
classes('checkout__section sharing align-center-button amp-izooto-sub ads__container inline-story-add amp-ad readmore__box'),
dict(name=(('amp-web-push-widget', 'amp-ad'))),
dict(attrs={'id':'tab-link-wrapper-plugin'}),
dict(name='div', attrs={'amp-access':'NOT granted'})