Compare commits
3 commits
7186957eb0
...
257d61aefc
Author | SHA1 | Date | |
---|---|---|---|
257d61aefc | |||
9a52805213 | |||
d9ee0a632e |
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(
|
article_record.dfp_targeting_id = article_soup.find(
|
||||||
"script", {"class": "dfp_targeting", "data-key": "id"}
|
"script", {"class": "dfp_targeting", "data-key": "id"}
|
||||||
)["data-value"]
|
)["data-value"]
|
||||||
except NameError:
|
except (NameError, TypeError):
|
||||||
print("Could not find or load IDs for this post")
|
print("Could not find or load IDs for this post")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tags = article_soup.find(
|
tags = article_soup.find(
|
||||||
"script", {"class": "dfp_targeting", "data-key": "tags"}
|
"script", {"class": "dfp_targeting", "data-key": "tags"}
|
||||||
)["data-value"].split("|")
|
)["data-value"].split("|")
|
||||||
except NameError:
|
except (NameError, TypeError):
|
||||||
print("Could not find or load any tags for this article")
|
print("Could not find or load any tags for this article")
|
||||||
tags = []
|
tags = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue