I am trying to read the latest HTML file in a folder and convert it to a pandas df and export as csv/excel. I found a solution to read a file but not the latest file. Please help!
To read a file:
for i, df in enumerate(pd.read_html(filepath)):
df.to_csv('myfile_%s.csv' % i)
return df;
But I need to read the latest file in a folder.