mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update indian_express.recipe
This commit is contained in:
parent
68851263a4
commit
a7925b7d2e
@ -99,16 +99,22 @@ class IndianExpress(BasicNewsRecipe):
|
|||||||
|
|
||||||
def articles_from_soup(self, soup):
|
def articles_from_soup(self, soup):
|
||||||
ans = []
|
ans = []
|
||||||
div = soup.find('div', attrs={'class':['nation', 'o-opin']})
|
div = soup.find('div', attrs={'class': ['nation', 'o-opin', 'myie-nation']})
|
||||||
for art in div.findAll(attrs={'class':['articles', 'o-opin-article']}):
|
for art in div.findAll(
|
||||||
|
attrs={'class': ['articles', 'o-opin-article', 'myie-articles']}
|
||||||
|
):
|
||||||
for a in art.findAll('a', href=True):
|
for a in art.findAll('a', href=True):
|
||||||
if not a.find('img') and not ('/profile/' in a['href'] or '/agency/' in a['href']):
|
if not a.find('img') and not any(
|
||||||
|
x in a['href'] for x in ['/profile/', '/agency/', '/section/']
|
||||||
|
):
|
||||||
url = a['href']
|
url = a['href']
|
||||||
title = self.tag_to_string(a)
|
title = self.tag_to_string(a)
|
||||||
desc = ''
|
desc = ''
|
||||||
if p:= art.find('p'):
|
if p := art.find('p'):
|
||||||
desc = self.tag_to_string(p)
|
desc = self.tag_to_string(p)
|
||||||
if da := art.find('div', attrs={'class':['date', 'o-opin-date']}):
|
if da := art.find(
|
||||||
|
'div', attrs={'class': ['date', 'o-opin-date', 'my-time']}
|
||||||
|
):
|
||||||
date = parse_date(self.tag_to_string(da)).replace(tzinfo=None)
|
date = parse_date(self.tag_to_string(da)).replace(tzinfo=None)
|
||||||
today = datetime.now()
|
today = datetime.now()
|
||||||
if (today - date) > timedelta(self.oldest_article):
|
if (today - date) > timedelta(self.oldest_article):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user