Incorrect date parsing #1082
alex440440
started this conversation in
General
Replies: 1 comment
-
@alex440440 i also had the same idea but wasn't sure of the reason of the delayed date. i thought it's a timezone issue between the server you use to run the scrapper. in all cases this repo is dead and i created a fork with better support for teh new version of fb : https://github.com/moda20/facebook-scraper, you can check there and see if you still have the issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The parser sets post date to a date older than the actual post date.
In the line below, the dateparser calculates the date as specified amount before the RELATIVE_BASE.
https://github.com/kevinzg/facebook-scraper/blob/567711fbab3e014504a1d4f33f882c2b29d71584/facebook_scraper/utils.py#L191C17-L191C17
Since the RELATIVE_BASE points to the start of the day - datetime.today().replace(minute=0, hour=0, second=0, microsecond=0), the post date will be reflected as if scraping was done at the start of the day, while the page is generated at the scraping time.
I think it would make sense to expose the option to set the RELATIVE_BASE via the API.
In case it's not feasible, it seems to me a reasonable default would be datetime.now(), since the dime delta has a fine resolution when the post was made near the time of scraping, and has lower resolution when far from time of scraping.
I don't know if this decision was intentional, so didn't open an issue.
Beta Was this translation helpful? Give feedback.
All reactions