Update New York Times

This commit is contained in:
Kovid Goyal 2020-02-12 07:27:44 +05:30
parent a370e028a3
commit 2862b4cdd2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 16 deletions

View File

@ -266,14 +266,11 @@ class NewYorkTimes(BasicNewsRecipe):
if article.get('description'): if article.get('description'):
self.log('\t\t', article['description']) self.log('\t\t', article['description'])
container = soup.find(itemtype='http://schema.org/CollectionPage') container = soup.find(id='collection-{}'.format(slug)).find('section')
container.find('header').extract() for ol in container.findAll('ol'):
div = container.find('div') for article in self.parse_article_group(ol):
for section in div.findAll('section'): log(article)
for ol in section.findAll('ol'): yield article
for article in self.parse_article_group(ol):
log(article)
yield article
def parse_web_sections(self): def parse_web_sections(self):
self.read_nyt_metadata() self.read_nyt_metadata()

View File

@ -266,14 +266,11 @@ class NewYorkTimes(BasicNewsRecipe):
if article.get('description'): if article.get('description'):
self.log('\t\t', article['description']) self.log('\t\t', article['description'])
container = soup.find(itemtype='http://schema.org/CollectionPage') container = soup.find(id='collection-{}'.format(slug)).find('section')
container.find('header').extract() for ol in container.findAll('ol'):
div = container.find('div') for article in self.parse_article_group(ol):
for section in div.findAll('section'): log(article)
for ol in section.findAll('ol'): yield article
for article in self.parse_article_group(ol):
log(article)
yield article
def parse_web_sections(self): def parse_web_sections(self):
self.read_nyt_metadata() self.read_nyt_metadata()