mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
...
This commit is contained in:
parent
af89c59f0d
commit
9d712f55de
@ -53,11 +53,24 @@ class HBR(BasicNewsRecipe):
|
||||
for a in h3.findAll(
|
||||
'a', href=lambda x: x.startswith('/' + d.strftime('%Y') + '/')
|
||||
):
|
||||
ul = a['href']
|
||||
url = 'https://hbr.org' + ul
|
||||
title = self.tag_to_string(a)
|
||||
self.log(title, ' at ', url)
|
||||
ans.append({'title': title, 'url': url})
|
||||
url = a['href']
|
||||
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)]
|
||||
|
||||
# HBR changes the content it delivers based on cookies, so the
|
||||
|
Loading…
x
Reference in New Issue
Block a user