diff --git a/kuow_fetcher.py b/kuow_fetcher.py index 98590cd..880a6a4 100644 --- a/kuow_fetcher.py +++ b/kuow_fetcher.py @@ -107,14 +107,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 = []