guptarohit / cryptoCMD

Cryptocurrency historical price data library in Python. Data from https://coinmarketcap.com.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: time data does not match format

LachubCz opened this issue · comments

This is a(n):

  • New feature
  • Update to an existing feature
  • Error
  • Proposal to the Repository

Details:

When I run your example script, I get this message

Traceback (most recent call last):
File "test.py", line 12, in
scraper.export("csv", name="btc_all_time")
File "/home/pi/.local/lib/python2.7/site-packages/cryptocmd/core.py", line 207, in export
data = self.get_data(format, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/cryptocmd/core.py", line 105, in get_data
self._download_data(**kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/cryptocmd/core.py", line 84, in _download_data
self.end_date, self.start_date, self.headers, self.rows = extract_data(table)
File "/home/pi/.local/lib/python2.7/site-packages/cryptocmd/utils.py", line 150, in extract_data
row[0] = datetime.datetime.strptime(row[0], "%b %d %Y").strftime("%d-%m-%Y")
File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
(data_string, format))
ValueError: time data '3981.90\nUSD' does not match format '%b %d %Y'

Hi @LachubCz,
Thanks for reporting this issue 👍
I just checked, this error is due to the recent changes on the UI of the historical-data page of Coinmarketcap. Will make the required changes.