1

I am trying to fetch data from this link using Google Sheets' ImportXML function.

This is a betting site, and the link displays a list of roulette roll IDs on 26 June 2020. I am trying to fetch that data in the following sample format:

  1. #5317018 - 3
  2. #5317019 - 12
  3. #5317020 - 14
  4. .....

I used the following command, with no result:

=importxml("https://csgoempire.com/history?seed=1997","/html/body/div[1]/div[1]/div[3]/div/div/div[1]/div/div")

Can you help me, please?

  • 1
    That site seems to be using some sort of client-side rendering, meaning that the html page doesn't contain the info you want. Adding the content to the page is done with Javascript, so that's why what you tried isn't working. – Bas van der Linden Jun 28 '20 at 18:09
3

From a comment to the question

That site seems to be using some sort of client-side rendering, meaning that the html page doesn't contain the info you want. Adding the content to the page is done with Javascript, so that's why what you tried isn't working. – Bas van der Linden Jun 28 at 18:09

@BasvanderLinden is right; the site itself doesn't contain any information about the rolls. If you inspect the site with the developer tools of your browser, you can find out that the rolls themselves are fetched by a call to this URL: https://csgoempire.com/api/v2/metadata/roulette/history?seed=1997. Those are in JSON, not XML, so you have to do a bit more work in order to import them in your sheet. See the question How to import JSON data into Google Spreadsheets?

  • thank you very much! The URL you showed worked perfectly well with function ImportJSON. It was until recently that, the same formula started to give #ERROR! result. The details of the error was - Exception: Request failed for csgoempire.com returned code 403. Truncated server response: {"blocked":true,"country":"USA","ip":"107.178.193.127"}. Not sure what this means, but seems like server blocks the request? The formula that was working for me: =ImportJSON(csgoempire.com/api/v2/metadata/roulette/history?seed=1997, "/", "noInherit,noTruncate,noPrefixHeaders",94). – Sabuhi Aug 29 '20 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.