I\'m trying to scrape the data from the coins catalog.
There is one of the pages. I need to scrape this data into Dataframe
So far I have this code:
<
Just a head's up... This part of Rakesh's code means that only HTML rows containing text will be included in the dataframe, as the rows don't get appended if row is an empty list:
if row:
res.append(row)
Problematic in my use case, where I wanted to compare row indexing for the HTML and dataframe tables later on. I just needed to change it to:
res.append(row)
Also, if a cell in the row is empty, it doesn't get included. This then messes up the columns. So I changed
row = [tr.text.strip() for tr in td if tr.text.strip()]
to
row = [d.text.strip() for d in td]
But, otherwise, it's working for me. Thanks :)