Last active
April 25, 2020 22:33
-
-
Save josephNg95/5aa787471f5e929e796a7e5440e2e46e to your computer and use it in GitHub Desktop.
Get youtube video title in the list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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