cosmetic cleanup
This commit is contained in:
@ -88,7 +88,6 @@ def get_recipe_from_source(text, url, space):
|
||||
if 'url' in parse_list[0]:
|
||||
url = parse_list[0]['url']
|
||||
|
||||
|
||||
# first try finding ld+json as its most common
|
||||
for el in parse_list:
|
||||
|
||||
@ -136,7 +135,7 @@ def get_from_html(soup):
|
||||
html.append(s)
|
||||
return html
|
||||
|
||||
# todo - look for site info in the soup
|
||||
|
||||
def get_images_from_source(soup, url):
|
||||
sources = ['src', 'srcset', 'data-src']
|
||||
images = []
|
||||
@ -165,6 +164,7 @@ def get_images_from_source(soup, url):
|
||||
images.append(u)
|
||||
return images
|
||||
|
||||
|
||||
def remove_graph(el):
|
||||
# recipes type might be wrapped in @graph type
|
||||
if isinstance(el, Tag):
|
||||
@ -176,4 +176,4 @@ def remove_graph(el):
|
||||
for x in el['@graph']:
|
||||
if '@type' in x and x['@type'] == 'Recipe':
|
||||
el = x
|
||||
return el
|
||||
return el
|
||||
|
Reference in New Issue
Block a user