Merge pull request 'Update metadata exception types to catch TypeErrors' (#19) from update-metadata-exceptions into main
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
Reviewed-on: #19
This commit is contained in:
commit
257d61aefc
1 changed files with 2 additions and 2 deletions
|
@ -127,14 +127,14 @@ with Session(engine) as session:
|
|||
article_record.dfp_targeting_id = article_soup.find(
|
||||
"script", {"class": "dfp_targeting", "data-key": "id"}
|
||||
)["data-value"]
|
||||
except NameError:
|
||||
except (NameError, TypeError):
|
||||
print("Could not find or load IDs for this post")
|
||||
|
||||
try:
|
||||
tags = article_soup.find(
|
||||
"script", {"class": "dfp_targeting", "data-key": "tags"}
|
||||
)["data-value"].split("|")
|
||||
except NameError:
|
||||
except (NameError, TypeError):
|
||||
print("Could not find or load any tags for this article")
|
||||
tags = []
|
||||
|
||||
|
|
Loading…
Reference in a new issue