diff --git a/recipes/1843.recipe b/recipes/1843.recipe index 5a77a63524..dd091ec0ad 100644 --- a/recipes/1843.recipe +++ b/recipes/1843.recipe @@ -190,6 +190,7 @@ class Econ1843(BasicNewsRecipe): delay = 3 remove_empty_feeds = True ignore_duplicate_articles = {'title'} + browser_type = 'webengine' needs_subscription = False diff --git a/recipes/economist_news.recipe b/recipes/economist_news.recipe index 3fcb347c37..85d3e5e19a 100644 --- a/recipes/economist_news.recipe +++ b/recipes/economist_news.recipe @@ -26,7 +26,9 @@ def process_web_list(li_node): li_html = '' for li in li_node['items']: if li.get('textHtml'): - li_html += f'
  • {li.get("textHtml")}
  • ' + li_html += f'
  • {li["textHtml"]}
  • ' + elif li.get('textJson'): + li_html += f'
  • {parse_textjson(li["textJson"])}
  • ' else: li_html += f'
  • {li.get("text", "")}
  • ' return li_html @@ -78,12 +80,16 @@ def process_web_node(node): elif node.get('textJson'): return f'

    {parse_textjson(node["textJson"])}

    ' return f'

    {node.get("text", "")}

    ' - elif ntype == 'IMAGE': + elif (ntype == 'IMAGE') or (node.get('__typename', '') == 'ImageComponent'): alt = '' if node.get('altText') is None else node.get('altText') cap = '' if node.get('caption'): if node['caption'].get('textHtml') is not None: cap = node['caption']['textHtml'] + elif node['caption'].get('textJson') is not None: + cap = parse_textjson(node['caption']['textJson']) + elif node['caption'].get('text') is not None: + cap = node['caption']['text'] return f'
    {cap}
    ' elif ntype == 'PULL_QUOTE': if node.get('textHtml'): @@ -127,6 +133,9 @@ def load_article_from_web_json(raw): main_image_url = safe_dict(data, 'leadComponent') or '' if main_image_url: body += process_web_node(data['leadComponent']) + if data.get('byline'): + if data['byline'] is not None: + body += f'

    {"By " + data["byline"]}

    ' for node in data.get('body'): body += process_web_node(node) return '
    ' + body + '
    ' @@ -204,7 +213,7 @@ class EconomistNews(BasicNewsRecipe): ' perspective. Get the latest articles here.' ) extra_css = ''' - em { color:#202020; } + em, blockquote { color:#202020; } img {display:block; margin:0 auto;} ''' @@ -273,7 +282,7 @@ class EconomistNews(BasicNewsRecipe): def economist_test_article(self): return [('Articles', [{'title': 'test', - 'url': 'https://www.economist.com/interactive/britain/2025/06/26/how-wimbledon-gets-its-grass-so-green' + 'url': 'https://www.economist.com/1843/2025/05/16/the-rise-fall-and-contested-future-of-hizbullah' }])] def economist_return_index(self, ans):