Here's a quick python3 script to get the table from each html page as a local csv file.
basically, you have to create a loop over all dates and then make a web requests. the python library pandas has a nice function .read_html(), which in this case parses the table directly into a dataframe. .read_html() returns an array of dataframes, and since the code recognizes several "tables", I'm taking the last one from each html page.
(note when scraping, it's good to make a local copy and then parse that file, since the web server may block your ip address).
import pandas as pd
from datetime import timedelta, date
url_base = 'https://coinmarketcap.com/historical/'
def daterange(start_date, end_date):
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)
start_date = date(2014, 1, 1)
end_date = date(2019, 12, 31)
for single_date in daterange(start_date, end_date):
url = url_base + single_date.strftime("%Y%m%d")
df = pd.read_html(url)[-1]
if df is not None:
#break # debugging
I started on 2014-01-01 since there is no data from 2013-01-01.