mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
economist
This commit is contained in:
parent
375e63f597
commit
fd5341919f
@ -205,6 +205,10 @@ class Economist(BasicNewsRecipe):
|
||||
def preprocess_raw_html(self, raw, url):
|
||||
# open('/t/raw.html', 'wb').write(raw.encode('utf-8'))
|
||||
root = parse(raw)
|
||||
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>'
|
||||
script = root.xpath('//script[@id="__NEXT_DATA__"]')
|
||||
if script:
|
||||
try:
|
||||
|
@ -205,6 +205,10 @@ class Economist(BasicNewsRecipe):
|
||||
def preprocess_raw_html(self, raw, url):
|
||||
# open('/t/raw.html', 'wb').write(raw.encode('utf-8'))
|
||||
root = parse(raw)
|
||||
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>'
|
||||
script = root.xpath('//script[@id="__NEXT_DATA__"]')
|
||||
if script:
|
||||
try:
|
||||
|
@ -201,6 +201,10 @@ class Economist(BasicNewsRecipe):
|
||||
def preprocess_raw_html(self, raw, url):
|
||||
# open('/t/raw.html', 'wb').write(raw.encode('utf-8'))
|
||||
root = parse(raw)
|
||||
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>'
|
||||
script = root.xpath('//script[@id="__NEXT_DATA__"]')
|
||||
if script:
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user