mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
...
This commit is contained in:
parent
d353c5afe6
commit
b8cdf762ee
@ -80,7 +80,11 @@ class wapoprint(BasicNewsRecipe):
|
||||
feeds.append((secname, articles))
|
||||
return feeds
|
||||
|
||||
def preprocess_raw_html(self, raw, *a):
|
||||
def preprocess_raw_html(self, raw, url):
|
||||
if '/interactive/' in url:
|
||||
return ('<html><body><article><h1>' + root.xpath('//h1')[0].text + '</h1><em>'
|
||||
'This article is supposed to be read in a browser.'
|
||||
'</em></article></body></html>')
|
||||
root = parse(raw)
|
||||
m = root.xpath('//script[@id="__NEXT_DATA__"]')
|
||||
|
||||
@ -89,10 +93,7 @@ class wapoprint(BasicNewsRecipe):
|
||||
|
||||
text = data.get('label', {}).get('basic', {}).get('text', '')
|
||||
label = f'<p class="time">{text}</p>' if text else ''
|
||||
if data.get('headlines'):
|
||||
title = '<h1>' + data['headlines']['basic'] + '</h1>'
|
||||
elif data.get('metadata'):
|
||||
title = '<h1>' + data['metadata']['headlines']['basic'] + '</h1>'
|
||||
subhead = '<p class="subt">' + data['description'].get('basic', '') + '</h3>'
|
||||
|
||||
promo_img = ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user