Last active
October 20, 2022 14:46
-
-
Save Silica163/e47f916312780d118befe9f9b4d4df10 to your computer and use it in GitHub Desktop.
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
/* | |
เขียนมาใช้ในโปรเจ็กย่อย ซึ่งต้องเก็บ follower/following ของคนใน ig | |
วิธีใช้ก็ ไปดู follower/following ของคนที่อยากเก็บ ไถๆชื่อไปให้หมดหน้า | |
แล้วก็ก็อบโค้ดไปใส่ใน developer tools กด enter ก็จะได้ array ไปใช้ | |
แนะนำให้เปิด responsive design mode (firefox), device toolbar (chrome/edge) | |
ไว้เป็นแบบมือถือด้วยเพราะส่วนตัวรู้สึกว่ามันไถง่ายกว่า | |
*/ | |
// เก็บ username ของ instagram | |
// return username มาเป็น array | |
function start(){ | |
var userList = []; | |
var allName = document.getElementsByClassName("_ab8y"); | |
for(var el of allName)userList.push(getUserName(el)); | |
console.log(JSON.stringify(userList.filter(val=>val.indexOf("Verified")==-1))); | |
return userList | |
} | |
function getUserName(el){ | |
return el.innerText; | |
} | |
console.log(start()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment