mariostoev/finviz

ValueError: time data '\r\n Today 07:00AM\r\n ' does not match format '%b-%d-%y %I:%M%p'

Closed this issue · 0 comments

sw8989 commented

When calling get_news, I get the following error:

File "/opt/homebrew/lib/python3.11/site-packages/finviz/main_func.py", line 116, in get_news
parsed_timestamp = datetime.strptime(raw_timestamp, "%b-%d-%y %I:%M%p")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '\r\n Today 07:00AM\r\n ' does not match format '%b-%d-%y %I:%M%p'