Created
January 25, 2023 09:48
-
-
Save cyrillsemenov/d72833927e398ac8d68bf8572c2b1f38 to your computer and use it in GitHub Desktop.
This is how you can try to scrape all comments from FB post just using console
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
let comments = document.querySelectorAll('[role="article"]'); | |
let result = ""; | |
for (let i = 1; i < comments.length-2; i++) { | |
let data = comments[i].querySelectorAll('span'); | |
result = result + `${i}, \"Name: ${data[5].textContent}\", \"Comment(can be broken): ${data[6].textContent}\",\"Full text: ${data.textContent}\"\n`; | |
} | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment