2

I'm doing a Google Sheets training video on using XPATH and IMPORTXML on YouTube but YouTube seems to have updated their site and now the import option won't work for extracting total video views.

Does anyone how to do this?

The closest I got is:

=IMPORTXML("https://www.youtube.com/channel/UC8p19gUXJYTsUPEpusHgteQ/videos","//div[@class='style-scope.ytd-grid-video-renderer']/span/text")'
2

Maybe:

=+importxml("https://www.youtube.com/channel/UC8p19gUXJYTsUPEpusHgteQ","//*[contains (@class, 'view-count')]")

If you want the number only (say for further processing):

=--REGEXEXTRACT(+importxml("https://www.youtube.com/channel/UC8p19gUXJYTsUPEpusHgteQ","//*[@class='view-count']"),"[\d|,]+") 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.