Closed kinoute closed 2 years ago
Hi @kinoute, I cannot reproduce the bug, I think it has to do with your setting. The error log hints at another function also named strptime
which interferes with datetime
's strptime
function.
Here is a one-liner to reproduce the error using vanilla official Python docker image:
docker run --rm python:3.8.12 /bin/bash -c "pip3 install htmldate; python3 -c \"from htmldate import find_date; find_date('https://osmh.dev', extensive_search=False, outputformat='%Y-%m-%d %H:%m:%S')\""
Thanks, I can see the problem now.
@kinoute it's fixed, I will ship a new release very soon.
Please not that changing extraction granularity affects the result for the case you mention:
outputformat='%Y-%m-%d %H:%m:%S'
does not return any date because of the datetime
issue above (which I have no time to investigate further)outputformat='%Y-%m-%d'
returns the correct date
Hello there,
Thanks for this great project! I encountered a problem while crawling different websites and trying to extract dates with this package. Especially on this URL: https://osmh.dev
Here is the error using iPython and Python 3.8.12:
The last example throws an error: