I have tried this, but I get three dots
=IMPORTXML("https://covid19.sabah.digital/covid19/","//span[@class='number-last_updated']")
I have tried this, but I get three dots
=IMPORTXML("https://covid19.sabah.digital/covid19/","//span[@class='number-last_updated']")
When I saw the HTML data, it seems that the last updated date is displayed by Javascript. By this, unfortunately, the value cannot be directly retrieved with IMPORTXML
. This has already been mentioned in the comments.
When I saw the HTML data again, I noticed that the information of date is included in https://data.covid19.sabah.digital/global.json
. From this data, how about retrieving the last updated date? In this answer, as a workaround, in order to retrieve the last updated value, I would like to propose to retrieve the data using the following sample formula.
=TEXT(MAX(ARRAYFORMULA(DATEVALUE(REGEXEXTRACT(QUERY(IMPORTDATA(A1),"SELECT Col1 WHERE Col1 contains 'date'"),"\d{4}-\d{1,2}-\d{1,2}"))))+1,"yyyy-MM-dd")
https://data.covid19.sabah.digital/global.json
to the cell "A1".IMPORTDATA
.QUERY
.DATEVALUE
.MAX
.
1
, it is the updated date.+1
from the formula.TEXT
.