diff --git a/recipes/scmp.recipe b/recipes/scmp.recipe index ba3abf18d0..fcaba61257 100644 --- a/recipes/scmp.recipe +++ b/recipes/scmp.recipe @@ -163,7 +163,7 @@ class SCMP(BasicNewsRecipe): load_article_from_json(script[0].text, b_root) except Exception: return raw_html - head = root.xpath('//h2') + root.xpath('//h3') + head = b_root.xpath('//h2') + b_root.xpath('//h3') for h2 in head: h2.tag = 'h4' raw = etree.tostring(b_root, encoding='unicode') diff --git a/recipes/tls_mag.recipe b/recipes/tls_mag.recipe index 1b301d15c0..f3c019685d 100644 --- a/recipes/tls_mag.recipe +++ b/recipes/tls_mag.recipe @@ -118,18 +118,6 @@ class tls(BasicNewsRecipe): else: prim = title = desc = label = auth = lede = '' - bks = '' - if 'bookdetails' in data and data['bookdetails']: - bks += '
' - for a in data['bookdetails']: - for x, y in a.items(): - if isinstance(y, str): - if x == 'imageurl': - bks += ''.format(y) - elif y: - bks += '
' + y + '
\n' - bks += '
' - if 'article_data_leadimage' in data: i = data['article_data_leadimage'] if 'full_image' in i and i['full_image']: @@ -138,7 +126,20 @@ class tls(BasicNewsRecipe): + i['imagecredit'] + '' ) cont = self.index_to_soup('https://www.the-tls.co.uk/wp-json/tls/v2/single-article/' + data['ID'], raw=True) - body = json.loads(cont)['content'] + c_data = json.loads(cont) + body = c_data['content'] + + bks = '' + if 'bookdetails' in c_data and c_data['bookdetails']: + bks += '
' + for a in c_data['bookdetails']: + for x, y in a.items(): + if isinstance(y, str): + if x == 'imageurl': + bks += ''.format(y) + elif y: + bks += '
' + y + '
\n' + bks += '
' html = '
' \ + label + title + desc + auth + lede + bks + body + \