Search code examples
google-sheetsxpathimportgoogle-sheets-formulaformula

Google Sheets ImportXML on Coinmarketcap.com


I have a google sheet that I use to track crypto positions and I'm using ImportXML to grab the current price of the coin off of coinmarketcap.com. All of them work with the same set of parameters:

  1. URL https://coinmarketcap.com/currencies//
  2. Full XPath: /html/body/div[1]/div[1]/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div/span

Formula: =IMPORTXML("https://coinmarketcap.com/currencies/the-sandbox/", "/html/body/div[1]/div[1]/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div/span", "en US")

This works for every coin I've tried EXCEPT SAND (https://coinmarketcap.com/currencies/the-sandbox/) and I've no clue why. I have tried pretty much every combination of the path I can think of.

Does anyone have any ideas? I am totally stuck on this one.


Solution

  • try:

    =IMPORTXML("https://coinmarketcap.com/currencies/the-sandbox/"; 
     "//div[@class='priceValue ']")
    

    enter image description here