Periodically refresh IMPORTXML() spreadsheet function

I made a couple of adjustments to Mogsdad’s answer: Fixed the releaseLock() call placement Updates (or adds) a querystring parameter to the url in the import function (as opposed to storing, removing, waiting 5 seconds, and then restoring all relevant formulas) Works on a specific sheet in your spreadsheet Shows time of last update … … Read more

How would I import YouTube Likes and Dislikes and a ratio from YouTube onto Google Sheets? [closed]

TITLE: =IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”,”//*[@id=’eow-title’]”) =REGEXEXTRACT(QUERY(ARRAY_CONSTRAIN(IMPORTDATA(A12), 500, 1), “where Col1 contains ‘/title'”, 0), “>(.+)<“) VIEWS: =VALUE(REGEXREPLACE(TEXT(IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”, “//*[contains(@class, ‘watch-view-count’)]”),0),” view(s)?”,””)) DURATION: =SUBSTITUTE(REGEXREPLACE(IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”,”//*[@itemprop=’duration’]/@content”),”PT|S”,””),”M”,”:”) LIKES: =IF(ISNA(IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”,”(//*[contains(@class,’like-button-renderer-like-button’)])[1]”))=TRUE,0, IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”,”(//*[contains(@class,’like-button-renderer-like-button’)])[1]”)) DISLIKES: =IF(ISNA(IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”,”(//*[contains(@class,’like-button-renderer-dislike-button’)])[1]”))=TRUE,0, IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”,”(//*[contains(@class,’like-button-renderer-dislike-button’)])[1]”)) UPLOADED: =REGEXREPLACE(IMPORTXML(“https://www.youtube.com/watch?v=MkgR0SxmMKo”, “//*[contains(@class, ‘watch-time-text’)]”),”((Uploaded)|(Published)|(Streamed live)) on “,””) SUBSCRIPTIONS: =IFERROR(MID(QUERY(IMPORTXML(“https://www.youtube.com/channel/”&A1, “//div[@class=”primary-header-actions”]”), “select Col1”), 31, 20), ) CHANNEL NAME: =INDEX(IMPORTHTML(“https://www.youtube.com/channel/UC7_gcs09iThXybpVgjHZ_7g”,”list”,1),1,1) CHANNEL ID: =ARRAYFORMULA(REGEXREPLACE(QUERY(SUBSTITUTE(ARRAY_CONSTRAIN( IMPORTDATA(https://www.youtube.com/watch?v=rckrnYw5sOA), 3000, 1), “”””, “”), “where Col1 contains ‘<meta itemprop=channelId … Read more

Google Sheets importXML Returns Empty Value

Answer: IMPORTXML can not retrieve data which is populated by a script, and so using this formula to retrieve data from this table is not possible to do. More Information: As you’ve already mentioned, you can attempt to get the data directly from the table using: =IMPORTXML(“https://kamadan.gwtoolbox.com/”,”//table[@id=’trader-overlay-items’]”) Which just gets a blank cell. I went … Read more