Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with datetime issue #143

Open
georgerichardson opened this issue May 4, 2017 · 4 comments
Open

Deal with datetime issue #143

georgerichardson opened this issue May 4, 2017 · 4 comments

Comments

@georgerichardson
Copy link

Sometimes no publication date is available and a blank string is returned. However the db model expects a date time.

Possible fix in scraper.Scraper.html_article:

if not isinstance(a.publish_date, datetime.datetime):
    article_pub_date = datetime.datetime.now()
else:
    article_pub_date = a.publish_date
@WanderingStar
Copy link
Contributor

Does it make more sense to use None/NULL? It seems misleading to say that the publication date of an article is when the scraper ran.

@domingohui
Copy link
Member

I think None makes more sense. If there had to be a date, a fallback could be the latest date mentioned in the article ( or the latest Report).

@simonb83
Copy link
Collaborator

Yeah agreed None makes more sense now that I think about it.

@georgerichardson
Copy link
Author

Yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants