mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Live Mint
This commit is contained in:
parent
d2baa161c7
commit
bbfa51852c
@ -1,4 +1,6 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
#!/usr/bin/env python
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||
|
||||
|
||||
class LiveMint(BasicNewsRecipe):
|
||||
@ -7,14 +9,28 @@ class LiveMint(BasicNewsRecipe):
|
||||
__author__ = 'Krittika Goyal'
|
||||
oldest_article = 1 # days
|
||||
max_articles_per_feed = 50
|
||||
encoding = 'utf-8'
|
||||
use_embedded_content = False
|
||||
|
||||
no_stylesheets = True
|
||||
auto_cleanup = True
|
||||
remove_attributes = ['style', 'height', 'width']
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name='h1'),
|
||||
dict(name='picture'),
|
||||
dict(name='figcaption'),
|
||||
classes('articleInfo FirstEle summary highlights paywall'),
|
||||
]
|
||||
remove_tags = [
|
||||
classes(
|
||||
'trendingSimilarHeight moreNews mobAppDownload label msgError msgOk'
|
||||
)
|
||||
]
|
||||
|
||||
feeds = [
|
||||
('Companies', 'https://www.livemint.com/rss/companies'),
|
||||
('Opinion', 'https://www.livemint.com/rss/opinion'),
|
||||
('Money', 'https://www.livemint.com/rss/money'),
|
||||
('Economy', 'https://www.livemint.com/rss/economy/'),
|
||||
('Politics', 'https://www.livemint.com/rss/politics'),
|
||||
('Science', 'https://www.livemint.com/rss/science'),
|
||||
('Industry', 'https://www.livemint.com/rss/industry'),
|
||||
@ -30,3 +46,8 @@ class LiveMint(BasicNewsRecipe):
|
||||
('Budget', 'https://www.livemint.com/rss/budget'),
|
||||
('Elections', 'https://www.livemint.com/rss/elections'),
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for img in soup.findAll('img', attrs={'data-src': True}):
|
||||
img['src'] = img['data-src']
|
||||
return soup
|
||||
|
Loading…
x
Reference in New Issue
Block a user