mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update New York Times
This commit is contained in:
parent
a370e028a3
commit
2862b4cdd2
@ -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()
|
||||||
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user