I'm trying to scrape the coinmarketcap website for its historical daily data (in a HTML table), but not getting the correct result. Below is the code. The code only returns the last row of the table. I'm doing something wrong with the loop...any help is greatly appreciated!
import requests
from bs4 import BeautifulSoup
import pandas as pd
data = requests.get('https://coinmarketcap.com/currencies/ethereum/historical-data')
soup = BeautifulSoup(data._content, 'lxml')
table = soup.find_all('table')[0]
#the table has 7 columns, about 30 rows
new_table = pd.DataFrame(columns=range(0,7), index = [0])
row_marker = 0
for row in table.find_all('tr'):
column_marker = 0
columns = row.find_all('td')
for column in columns:
new_table.iat[row_marker,column_marker] = column.get_text()
column_marker += 1
print (new_table.head())