mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
...
This commit is contained in:
parent
af89c59f0d
commit
9d712f55de
@ -53,11 +53,24 @@ class HBR(BasicNewsRecipe):
|
|||||||
for a in h3.findAll(
|
for a in h3.findAll(
|
||||||
'a', href=lambda x: x.startswith('/' + d.strftime('%Y') + '/')
|
'a', href=lambda x: x.startswith('/' + d.strftime('%Y') + '/')
|
||||||
):
|
):
|
||||||
ul = a['href']
|
|
||||||
url = 'https://hbr.org' + ul
|
|
||||||
title = self.tag_to_string(a)
|
title = self.tag_to_string(a)
|
||||||
self.log(title, ' at ', url)
|
url = a['href']
|
||||||
ans.append({'title': title, 'url': url})
|
url = 'https://hbr.org' + url
|
||||||
|
div = h3.find_next_sibling('div', attrs={'class': 'stream-item-info'})
|
||||||
|
if div:
|
||||||
|
auth = self.tag_to_string(div)
|
||||||
|
dek = h3.find_next_sibling('div', attrs={'class': 'dek'})
|
||||||
|
if dek:
|
||||||
|
des = self.tag_to_string(dek)
|
||||||
|
desc = des + ' |' + auth
|
||||||
|
self.log('\t', title)
|
||||||
|
self.log('\t', desc)
|
||||||
|
self.log('\t\t', url)
|
||||||
|
|
||||||
|
ans.append({
|
||||||
|
'title': title,
|
||||||
|
'url': url,
|
||||||
|
'description': desc})
|
||||||
return [('Articles', ans)]
|
return [('Articles', ans)]
|
||||||
|
|
||||||
# HBR changes the content it delivers based on cookies, so the
|
# HBR changes the content it delivers based on cookies, so the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user