mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Update The Federalist
This commit is contained in:
parent
6dc5ba94a7
commit
83cff90848
@ -39,7 +39,19 @@ class Federalist(BasicNewsRecipe):
|
|||||||
('All', 'http://thefederalist.com/feed/'),
|
('All', 'http://thefederalist.com/feed/'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for img in soup.findAll('img', attrs={'data-lazy-src': True}):
|
||||||
|
img['src'] = img['data-lazy-src']
|
||||||
|
seen = set()
|
||||||
|
for img in soup.findAll('img', src=True):
|
||||||
|
src = img['src']
|
||||||
|
if src in seen:
|
||||||
|
img.extract()
|
||||||
|
seen.add(src)
|
||||||
|
return soup
|
||||||
|
|
||||||
# def parse_index(self):
|
# def parse_index(self):
|
||||||
# return [('Articles', [
|
# return [('Articles', [
|
||||||
# {'title':'xxx', 'url':'http://thefederalist.com/2018/05/04/fans-take-on-marvel-dc-and-the-comic-book-industrys-sjw-self-destruction/'}
|
# {'title':'img', 'url':'http://thefederalist.com/2018/05/09/venezuelas-economic-problems-caused-socialism-not-falling-oil-prices/'},
|
||||||
|
# {'title':'xxx', 'url':'http://thefederalist.com/2018/05/04/fans-take-on-marvel-dc-and-the-comic-book-industrys-sjw-self-destruction/'},
|
||||||
# ])]
|
# ])]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user