kotartemiy / pygooglenews

If Google News had a Python library
https://newscatcherapi.com
MIT License
1.26k stars 134 forks source link

Exception: Could not parse your date #47

Open Lancelotnb opened 3 months ago

Lancelotnb commented 3 months ago

AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File ~\Documents\python class\pygooglenews.py:16 in s = gn.search( query="NVIDIA" , from = '2024-04-01', to = '2024-04-02' )

File ~\anaconda3\lib\site-packages\pygooglenews__init_.py:141 in search from = self.__from_tohelper(validate=from)

File ~\anaconda3\lib\site-packages\pygooglenews__init.py:93 in from_tohelper raise Exception('Could not parse your date'); the code works fine without from and to_, but It can't parse the date