Skip to content

Instantly share code, notes, and snippets.

@MarkZhangTW
Last active September 16, 2023 13:45
Show Gist options
  • Save MarkZhangTW/c80a1e0f27c4c73e3129452feaf365b8 to your computer and use it in GitHub Desktop.
Save MarkZhangTW/c80a1e0f27c4c73e3129452feaf365b8 to your computer and use it in GitHub Desktop.
Array.from(
document.querySelectorAll(
"html > body > div:nth-child(1) > div > div:nth-child(1)" +
"> div:nth-child(1) > div > div > div > div:nth-child(1)" +
"> div:nth-child(1)> div > div > div:nth-child(4) > div > div > div" +
"> div:nth-child(1) > div > div > div > div:nth-child(3) > div" +
"> div:nth-child(2) > div:nth-child(1) > a"
)
).map(tag =>
[tag.href.split("facebook.com/")[1].replace("profile.php?id=", ""), tag.querySelector("span").innerHTML]
.join("\t")
).reduce((a, b) => a + "\n" + b)
@MarkZhangTW
Copy link
Author

Array.from(new Set(Array.from(document.querySelectorAll('ul.uiList div._42ef > div > a')).map(tag => tag.getAttribute('data-hovercard').split('?')[1].split('&')[0].split('=')[1]).sort())).reduce((a, b) => a + '\n' + b)

@MarkZhangTW
Copy link
Author

console.log(Array.from(document.querySelectorAll('div > div:nth-child(1) > div > div.rq0escxv.l9j0dhe7.du4w35lb > div > div > div.j83agx80.cbu4d94t.d6urw2fd.dp1hu0rb.l9j0dhe7.du4w35lb > div.j83agx80.cbu4d94t.dp1hu0rb > div > div > div.bp9cbjyn.j83agx80.cbu4d94t.d2edcug0 > div > div > div > div:nth-child(1) > div > div > div > div > div.j83agx80.btwxx1t3.lhclo0ds.i1fnvgqd > div > div.buofh1pr.hv4rvrfc > div > a')).map(tag => tag.querySelector('span').innerHTML + "\t" + tag.href).reduce((a, b) => a + "\n" + b))

@MarkZhangTW
Copy link
Author

console.log(Array.from(document.querySelectorAll('#mount_0_0_YS > div > div:nth-child(1) > div > div.x9f619.x1n2onr6.x1ja2u2z > div > div > div > div.x78zum5.xdt5ytf.x1t2pt76.x1n2onr6.x1ja2u2z.x10cihs4 > div.x78zum5.xdt5ytf.x1t2pt76 > div > div > div.x6s0dn4.x78zum5.xdt5ytf.x193iq5w > div > div > div > div:nth-child(1) > div > div > div > div > div.x78zum5.x1q0g3np.x1a02dak.x1qughib > div > div > div > a')).map(tag => tag.querySelector('span').innerHTML + "\t" + tag.href).reduce((a, b) => a + "\n" + b))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment