1
0
mirror of https://github.com/fhamborg/news-please.git synced 2021-09-19 22:26:00 +03:00

Handle publish_date == "" in newspaper_extractor

This commit is contained in:
Frankie Robertson
2021-02-08 10:04:10 +02:00
parent d3c3eed26b
commit f9da1b7424

View File

@@ -33,7 +33,7 @@ class NewspaperExtractor(AbstractExtractor):
article_candidate.text = article.text
article_candidate.topimage = article.top_image
article_candidate.author = article.authors
if article.publish_date is not None:
if article.publish_date:
try:
article_candidate.publish_date = article.publish_date.strftime('%Y-%m-%d %H:%M:%S')
except ValueError as exception: