-1

I've got a spreadsheet set up which scrapes stock option prices from a list of stocks. These prices are obviously always changing. Is it possible to set a timer refresh on the ImportXML function (via script maybe) so that it will continue to perform the import every, say 1 minute?

Also, my sheet seems to cache the data as even if I update the sheet, a cells data will remain the same even though the number has updated on the site I'm scraping from.

Any help much appreciated.

jbt777
  • 1
  • 2

1 Answers1

0

For not getting cached response in importhtml, we can append some random query parameter in URL string.

var queryString = Math.random(); // This will generate random value
  sheetName.getRange('P7').setValue(queryString); // This random value will be placed in Cell P7

  var cellFunction = '=ImportHtml("URL?"&P7;"table";1)}'; // Value from P7 cell will be appended in URL to avoid caching issue
    sheetName.getRange('A1').setValue(cellFunction);