Page 1 of 1

Using Google Cache

Posted: May 19th, 2017, 2:44 pm
by ReformedCharacter
I've been playing around with Google Sheets and have made an interesting discovery which might be useful for users of other spreadsheets.

I found that using:

=IMPORTHTML(ʺhttp://www.dividenddata.co.uk/exdividenddate.p ... ,ʺtableʺ,1)

to extract dividend data does not work, I assume that it is somehow blocked by dividenddata.

However, asking the Google cache for the same data works:

=IMPORTHTML(ʺhttp://webcache.googleusercontent.com/search?q=cache:http://www.dividenddata.co.uk/exdividen ... ,ʺtableʺ,1)

A page can be obtained, as shown, by prefixing the URL with 'http://webcache.googleusercontent.com/search?q=cache:'

Of course there's no guarantee that the data in the cache will be up to date but for high volume sites and data that stays reasonably static, hour to hour, this may be a useful workaround.

RC

Re: Using Google Cache

Posted: May 25th, 2017, 7:21 pm
by epo1
Is "does not work" flagged in a detectable fashion? Because it should be easy to write macro code like

Code: Select all

If import from dividenddata is OK
then
  use those results
elseif import from google cache is OK
  use those results
fi

Re: Using Google Cache

Posted: May 27th, 2017, 10:11 pm
by HappyPlums
Hi ReformedCharacter

Thanks for that tip, neat idea. I'd not heard of the Google cache.

I had been using importhtml on the dividenddata site for around a year, but a while back it stopped working. This coincided with a little bit of a refresh on their site.

Now I just need to find a way to only refresh the import when I need it. The divi data does not change 'that' quickly