diff --git a/kuow_fetcher.py b/kuow_fetcher.py index 12fef0a..2a67edd 100644 --- a/kuow_fetcher.py +++ b/kuow_fetcher.py @@ -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 = []