trap error on scrape.title()
This commit is contained in:
parent
468b986314
commit
1e17f3703a
@ -13,7 +13,10 @@ def get_from_scraper(scrape, space):
|
|||||||
# converting the scrape_me object to the existing json format based on ld+json
|
# converting the scrape_me object to the existing json format based on ld+json
|
||||||
|
|
||||||
recipe_json = {}
|
recipe_json = {}
|
||||||
|
try:
|
||||||
recipe_json['name'] = scrape.title()
|
recipe_json['name'] = scrape.title()
|
||||||
|
except TypeError:
|
||||||
|
recipe_json['name'] = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
description = scrape.schema.data.get("description") or ''
|
description = scrape.schema.data.get("description") or ''
|
||||||
|
Loading…
Reference in New Issue
Block a user