kotartemiy / pygooglenews

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

Could not parse your date #34

Open tctopic opened 1 year ago

tctopic commented 1 year ago

This is my code.

s=gn.search('energy digital transformation',helper=True,from =date1.strftime("%Y-%m-%d"), to =date2.strftime("%Y-%m-%d"))

The following result is obtained.

Exception: Could not parse your date

Why can't it recognize the date?

nfallah commented 1 year ago

I did some research and apparently, it could be the issue with the parsedata module and regex, so I just went into the actual script and removed the part where it needed to parse any data in the first place; so if I already put it in the 'YYYY-MM-DD' format then this alteration would not affect the program whatsoever.

PaulKMandal commented 10 months ago

I did some research and apparently, it could be the issue with the parsedata module and regex, so I just went into the actual script and removed the part where it needed to parse any data in the first place; so if I already put it in the 'YYYY-MM-DD' format then this alteration would not affect the program whatsoever.

This "fix" doesn't work for me. Putting a string in 'YYYY-MM-DD' will still yield "error: bad escape \d at position 7" and throw the exception "Could not parse your date."