This commit is contained in:
Kovid Goyal 2024-01-30 10:59:10 +05:30
commit 0c66368c9e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 6 additions and 4 deletions

View File

@ -206,7 +206,7 @@ class Economist(BasicNewsRecipe):
# 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>' \
return '<html><body><article><h1 class="headline">' + 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__"]')

View File

@ -206,7 +206,7 @@ class Economist(BasicNewsRecipe):
# 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>' \
return '<html><body><article><h1 class="headline">' + 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__"]')

View File

@ -202,7 +202,7 @@ class Economist(BasicNewsRecipe):
# 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>' \
return '<html><body><article><h1 class="headline">' + 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__"]')

View File

@ -40,7 +40,7 @@ class ft(BasicNewsRecipe):
remove_tags = [
dict(name=['source', 'svg', 'button']),
dict(name='aside', attrs={'class':'n-content-recommended--single-story'}),
dict(name='aside', attrs={'class':'n-content-recommended--single-story flourish-disclaimer'}),
dict(attrs={'data-layout-name':'card'}),
classes('in-article-advert')
]
@ -81,6 +81,7 @@ class ft(BasicNewsRecipe):
open = open_novisit
feeds = [
('FirstFT', 'https://www.ft.com/firstft?format=rss'),
('Opinion', 'https://www.ft.com/opinion?format=rss'),
('World', 'https://www.ft.com/world?format=rss'),
('US', 'https://www.ft.com/us?format=rss'),
@ -90,6 +91,7 @@ class ft(BasicNewsRecipe):
('Climate', 'https://www.ft.com/climate-capital?format=rss'),
('Life & Arts', 'https://www.ft.com/life-arts?format=rss'),
('How to spend it', 'https://www.ft.com/htsi?format=rss'),
('Others', 'https://www.ft.com/rss/home/uk')
]
def preprocess_raw_html(self, raw, *a):