0

I'm trying to get the "Daily APR" to be updated on my google sheet, the ImportXML works, but only returns the value from 3 days ago, i.e "0.31% Daily" whereas the rates are updated every so often. (most recent is 0.2x%)

https://autofarm.network/bsc/281/

this was the ImportXML that works

=IMPORTXML("https://autofarm.network/bsc/281/","/html/body/div[1]/div[1]/div[3]/div[1]/div/div/div[2]/div[2]/div[1]/div[2]/div[3]")

Does anyone have any idea how to get the ImportXML to return me the most recent value and not the original value from when i scraped it 3 days ago?

  • Is the value always `0.31% Daily` when you use IMPORTXML? Also see my response to this similar question. I suspect it has to do with the fact that it is the JavaScript that updates this part. https://stackoverflow.com/a/67056410/10445017 – iansedano Jun 21 '21 at 07:45

1 Answers1

1

You are not getting latest result due the the value display come from Json API rather than write into the website, in such case, you will need to learn how to do web scraping using Json and also try to figure how to 0.18% daily was calculated, go to the website> Right click Inpect> Network> XHR, from there, I only know how the Share of pool & Total APY were obtained, 0.18% come from formula:

enter image description here

Reference (How to perform JSon Parse)

How to parse JSON response in Google App Script?

Kin Siang
  • 2,644
  • 2
  • 4
  • 8