This commit is contained in:
Kovid Goyal 2017-02-11 17:31:19 +05:30
parent e06288bc50
commit 5d35c23c5e
2 changed files with 12 additions and 12 deletions

View File

@ -147,17 +147,17 @@ class Economist(BasicNewsRecipe):
secname = self.tag_to_string(section)
self.log(secname)
for a in section.findNextSiblings('a', href=True):
title = (
self.tag_to_string(
a.find(attrs={'class': 'print-edition__link-title'})
) or self.tag_to_string(a)
)
spans = a.findAll('span')
if len(spans) == 2:
title = '{}: {}'.format(*map(self.tag_to_string, spans))
else:
title = self.tag_to_string(a)
articles.append({'title': title, 'url': process_url(a['href'])})
self.log(' ', title, articles[-1]['url'])
if articles:
feeds.append((secname, articles))
return feeds
self.economist_parse_old_index(soup)
return self.economist_parse_old_index(soup)
def economist_parse_old_index(self, soup):
feeds = OrderedDict()

View File

@ -147,17 +147,17 @@ class Economist(BasicNewsRecipe):
secname = self.tag_to_string(section)
self.log(secname)
for a in section.findNextSiblings('a', href=True):
title = (
self.tag_to_string(
a.find(attrs={'class': 'print-edition__link-title'})
) or self.tag_to_string(a)
)
spans = a.findAll('span')
if len(spans) == 2:
title = '{}: {}'.format(*map(self.tag_to_string, spans))
else:
title = self.tag_to_string(a)
articles.append({'title': title, 'url': process_url(a['href'])})
self.log(' ', title, articles[-1]['url'])
if articles:
feeds.append((secname, articles))
return feeds
self.economist_parse_old_index(soup)
return self.economist_parse_old_index(soup)
def economist_parse_old_index(self, soup):
feeds = OrderedDict()