Hi,
Your script is a good start.
My python is rusty, but I can give you some tips about it.
The most important thing I notice (if I understand it right), you load ALL the data set in lxml format, then parse the content to find only the rows you need and then create a list of rows of ALL the data to export into CSV.
I don't know the performance you expect from your program, but if not slow, it certainly eats up a lot of memory.
I think cryptomarketcap has a json output which might be easier to parse. You might want to look into it. (I have a similar project in NodeJS but I use the cryptocompare API instead because it's totally free).
For your CSV, you should try to save a line (or a couple of lines) as batches, not all at the same time, so you don't have to keep all your data in memory.
One approach I would also suggest, is to save your "raw" input as a temporary file and work on that file. Simply in case your program goes offline, or their endpoint is not available and you can't rerun your script right away. It should help with testing, so you can have a look at the file content and adapt your program without calling their API everytime.
Those are just my 2 cents, I am not sure I am really helping though hahaha.
Good luck, such programs are fun to build, and python is cool for that.
Well done!
Please bare in mind that this data is not actually accurate though - the timeframes will be a minute or so behind in some cases and the true value of the market would fluctuate depending on which is the target exchange. Previously, during my crypto-exploring days, I saw price differences between exchanges reaching 10-11% - not as a one off either.
If you create an account on almost any online exchange they have a public API which you can plug into for free and gather data from the source - if you wanted to take that as a next step. I can't remember how many of them allow historical records to the beginning of time though.
With respect to the user experience the ability to select the exchange would be good as well as fetch data between dates and/or times.
As a final thought you could begin to look into machine learning and figure out how to do
time-seriesanalysis on the data to predict the future..... lol.Have fun!