Created
September 28, 2023 09:20
-
-
Save Suleman-Elahi/8cc6c81a49966a9a0263883340a53c50 to your computer and use it in GitHub Desktop.
Get All YouTube Comments. Paste the code in the snippet after scrolling to the bottom when all the comments have been loaded.
This file contains hidden or 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
const comments = document.querySelectorAll("yt-formatted-string#content-text"); | |
comments.forEach((comment) => { | |
const commentText = comment.innerText; | |
const plainTextComment = commentText.replace(/<[^>]*>/g, ""); | |
console.log(plainTextComment); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment