This commit is contained in:
Kovid Goyal 2025-04-19 04:51:06 +05:30
parent 32818883bd
commit 3f8050f8cf
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View File

@ -34,11 +34,11 @@ class Espresso(BasicNewsRecipe):
use_embedded_content = False
masthead_url = 'https://www.livemint.com/lm-img/dev/economist-logo-oneline.png'
extra_css = """
extra_css = '''
h1 { text-align:center; }
._main-image, ._description, .sub, .calibre-nuked-tag-figcaption { text-align:center; font-size:small; }
._quote-container { font-size:x-large; font-style:italic; color:#202020; }
"""
'''
keep_only_tags = [dict(name='main', attrs={'id': 'content'})]

View File

@ -79,7 +79,7 @@ class Fokus(BasicNewsRecipe):
response = browser.open(req)
# Parse the response into a BeautifulSoup soup.
soup = BeautifulSoup(response.get_data(), "html.parser")
soup = BeautifulSoup(response.get_data(), 'html.parser')
# The cover image of the current edition is located in a <figure> tag with class 'Issue__thumbnail'.
try:
@ -88,7 +88,7 @@ class Fokus(BasicNewsRecipe):
# Set the `img_tag` to `None` if it is falsy. This way, we can force an `AttributeError` if no cover URL
# can be found.
img_tag = img_tag if img_tag else None
cover_url = img_tag["src"]
cover_url = img_tag['src']
except AttributeError:
self.log.error("Failed to identify the cover image URL. Does an 'Issue__thumbnail' figure still exist?")
return ''