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 = ''' extra_css = '''
.auth {font-size:small; font-weight:bold;} .auth {font-size:small; font-weight:bold;}
.time, .chart {font-size:small;} .time, .chart {font-size:small;}
.subhead {font-style:italic; color:#404040;} .subhead, blockquote {font-style:italic; color:#404040;}
.cat {font-size:small; color:gray;} .cat {font-size:small; color:gray;}
.news-figure-caption-text, .cap, .img {font-size:small; text-align:center;} .news-figure-caption-text, .cap, .img {font-size:small; text-align:center;}
.news-figure-credit {font-size:small; text-align:center; color:#202020;} .news-figure-credit {font-size:small; text-align:center; color:#202020;}
''' '''
articles_are_obfuscated = True articles_are_obfuscated = True
resolve_internal_links = True
def get_obfuscated_article(self, url): def get_obfuscated_article(self, url):
br = self.get_browser() 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' masthead_url = 'https://akm-img-a-in.tosshub.com/businesstoday/resource/img/logo.png'
keep_only_tags = [ keep_only_tags = [
dict(name='h1'), classes('story-heading sab-head-tranlate-sec user-detial-left main-img field--name-body'),
dict(name='h2'),
classes('brand-detial-main main-img story-with-main-sec'),
] ]
remove_tags = [ remove_tags = [
dict(name='a', attrs={'title': 'videos'}), dict(name='a', attrs={'title': 'videos'}),
@ -28,11 +26,11 @@ class BT(BasicNewsRecipe):
def parse_index(self): def parse_index(self):
soup = self.index_to_soup('https://www.businesstoday.in/magazine') soup = self.index_to_soup('https://www.businesstoday.in/magazine')
issue = soup.find(attrs={'class': 'view-id-latest_issue_magzine'}) issue = soup.find(attrs={'class': 'swiper-wrapper'})
a = issue.findAll('a', href=lambda x: x and x.startswith('/magazine/issue/'))[1] a = issue.findAll('a', href=lambda x: x and '/magazine/issue/' in x)[1]
url = a['href'] url = a['href']
self.log('issue =', url) 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'}) tag = soup.find(attrs={'class': 'issue-image'})
if tag: if tag:
self.cover_url = tag.find('img')['src'] self.cover_url = tag.find('img')['src']
@ -62,7 +60,7 @@ class BT(BasicNewsRecipe):
# Insert feeds in specified order, if available # Insert feeds in specified order, if available
feedSort = ['Editors Note'] feedSort = ['Editor\'s Note']
for i in feedSort: for i in feedSort:
if i in sections: if i in sections:
feeds.append((i, sections[i])) feeds.append((i, sections[i]))

View File

@ -38,7 +38,7 @@ class IndiaToday(BasicNewsRecipe):
''' '''
remove_tags = [ 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(name=(('amp-web-push-widget', 'amp-ad'))),
dict(attrs={'id':'tab-link-wrapper-plugin'}), dict(attrs={'id':'tab-link-wrapper-plugin'}),
dict(name='div', attrs={'amp-access':'NOT granted'}) dict(name='div', attrs={'amp-access':'NOT granted'})