mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Update Financial Times
Merge branch 'patch-2' of https://github.com/bobbysteel/calibre
This commit is contained in:
commit
c21a19da74
@ -86,12 +86,20 @@ class FinancialTimes(BasicNewsRecipe):
|
|||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
articles = []
|
articles = []
|
||||||
soup = self.index_to_soup(self.INDEX)
|
soup = self.index_to_soup(self.INDEX)
|
||||||
|
totalfeeds = []
|
||||||
for article in soup.findAll('a', href=True, attrs={'data-trackable':'main-link'}):
|
current_section = []
|
||||||
url = self.PREFIX + article['href']
|
div = []
|
||||||
title = self.tag_to_string(article)
|
for div in soup.findAll('div', attrs={'data-trackable': 'list'}):
|
||||||
articles.append({'title': title, 'url': url, 'description': '', 'date': ''})
|
articles = []
|
||||||
return [("Articles", articles)]
|
current_section = self.tag_to_string(div.find('h2'))
|
||||||
|
self.log('in section: ', current_section)
|
||||||
|
for article in div.findAll('a', href=True, attrs={'data-trackable':'main-link'}):
|
||||||
|
url = self.PREFIX + article['href']
|
||||||
|
title = self.tag_to_string(article)
|
||||||
|
articles.append({'title': title, 'url': url, 'description': '', 'date': ''})
|
||||||
|
self.log('title: ', title, ' url: ', url)
|
||||||
|
totalfeeds.append((current_section,articles))
|
||||||
|
return totalfeeds
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', srcset=True):
|
for img in soup.findAll('img', srcset=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user