From 2862b4cdd24d065c7df71b34008ae7fd94ff2428 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Feb 2020 07:27:44 +0530 Subject: [PATCH] Update New York Times --- recipes/nytimes.recipe | 13 +++++-------- recipes/nytimes_sub.recipe | 13 +++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/recipes/nytimes.recipe b/recipes/nytimes.recipe index 87c09c62d1..55f77237f6 100644 --- a/recipes/nytimes.recipe +++ b/recipes/nytimes.recipe @@ -266,14 +266,11 @@ class NewYorkTimes(BasicNewsRecipe): if article.get('description'): self.log('\t\t', article['description']) - container = soup.find(itemtype='http://schema.org/CollectionPage') - container.find('header').extract() - div = container.find('div') - for section in div.findAll('section'): - for ol in section.findAll('ol'): - for article in self.parse_article_group(ol): - log(article) - yield article + container = soup.find(id='collection-{}'.format(slug)).find('section') + for ol in container.findAll('ol'): + for article in self.parse_article_group(ol): + log(article) + yield article def parse_web_sections(self): self.read_nyt_metadata() diff --git a/recipes/nytimes_sub.recipe b/recipes/nytimes_sub.recipe index ffdf42d62a..02ff62ba3d 100644 --- a/recipes/nytimes_sub.recipe +++ b/recipes/nytimes_sub.recipe @@ -266,14 +266,11 @@ class NewYorkTimes(BasicNewsRecipe): if article.get('description'): self.log('\t\t', article['description']) - container = soup.find(itemtype='http://schema.org/CollectionPage') - container.find('header').extract() - div = container.find('div') - for section in div.findAll('section'): - for ol in section.findAll('ol'): - for article in self.parse_article_group(ol): - log(article) - yield article + container = soup.find(id='collection-{}'.format(slug)).find('section') + for ol in container.findAll('ol'): + for article in self.parse_article_group(ol): + log(article) + yield article def parse_web_sections(self): self.read_nyt_metadata()