Skip to content

Instantly share code, notes, and snippets.

@mayukojpn
Created October 29, 2016 14:27
Show Gist options
  • Save mayukojpn/315a87c1af5e7ad0bee11736db54c60b to your computer and use it in GitHub Desktop.
Save mayukojpn/315a87c1af5e7ad0bee11736db54c60b to your computer and use it in GitHub Desktop.
Facebook のコメントを取り出すコード
var list=document.getElementsByClassName('UFIList')[0].childNodes[2].childNodes[0];
for(var i=0;i<=list.length;i++){
if(list[i].className!==' UFIReplyList'){
var content = list[i].childNodes[0].childNodes[1].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes;
document.write(
i+','
+content[0].innerText+',' //comment
+content[0].childNodes[0].href+',"'//comment
+content[1].innerText//comment
+'"<br>');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment