Skip to content

Instantly share code, notes, and snippets.

@josephNg95
Last active April 25, 2020 22:33
Show Gist options
  • Save josephNg95/5aa787471f5e929e796a7e5440e2e46e to your computer and use it in GitHub Desktop.
Save josephNg95/5aa787471f5e929e796a7e5440e2e46e to your computer and use it in GitHub Desktop.
Get youtube video title in the list
function getYoutubeVideoTitleInList() {
let items = document.querySelectorAll('h4.style-scope')
let strTitles = ''
count = 0
while(count < items.length - 1) {
let title = items[count].innerText.trim()
strTitles += '\n' + title
count++
}
console.log(strTitles)
}
// With deep on channel list
function getYoutubeVideoTitleInList() {
let items = document.querySelectorAll('h3.style-scope')
let strTitles = ''
count = 0
while(count < items.length - 1) {
let title = items[count].innerText.trim()
strTitles += '\n' + title
count++
}
console.log(strTitles)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment