I am trying to webscrape coinmarketcap.com using selenium where I am trying to retrieve data such as coin name, coinmarket cap, price and circulation supply. However, I am not successful with this. I am only able to retrieve 11 alt coins and not more. Also, I have looked into several ways how to render javascrip (which I presume coinmarketcap is made in) using different methods. Here is the start of my code:
driver = webdriver.Chrome(r'C:\Users\Ejer\PycharmProjects\pythonProject\chromedriver')
driver.get('https://coinmarketcap.com/')
Crypto = driver.find_elements_by_xpath("//div[contains(concat(' ', normalize-space(@class), ' '), 'sc-16r8icm-0 sc-1teo54s-1 lgwUsc')]")
#price = driver.find_elements_by_xpath('//td[@class="cmc-link"]')
#coincap = driver.find_elements_by_xpath('//td[@class="DAY"]')
CMC_list = []
for c in range(len(Crypto)):
CMC_list.append(Crypto[c].text)
print(CMC_list)
driver.close()
My goal is to store the names, coinmarket cap, price and circulation supply in a dataframe so I can apply machine learning methods and analyze the data. So, I am open to any suggestions. Thank in advance