-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextract.js
More file actions
39 lines (31 loc) · 1.1 KB
/
extract.js
File metadata and controls
39 lines (31 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
`
This Script Work on Facebook
Maked For: Extract Group Members Profile Link's
--------------------------------------------------
Author : Md Sifat Islam
Github : cyber-programer
`
const bad_id_list = []; // all bad_links
const id_list = [];
// Function to scroll and collect links
async function scrollAndCollectLinks() {
// Scroll down the page in increments
for (let i = 0; i < 100; i++) {
window.scrollBy(0, window.innerHeight);
await new Promise(resolve => setTimeout(resolve, 500)); // Wait for content to load
}
// Collect links
const xpath = document.querySelectorAll("a[role='link'][tabindex='-1']");
xpath.forEach(element => {
bad_id_list.push(element.href);
});
// Process collected links
bad_id_list.forEach(elm => {
const user_id = elm.split('/')[6];
const url = `https://www.facebook.com/profile.php?id=${user_id}`;
id_list.push(url);
});
console.log(id_list.join(' \n'));
}
// Run the function
scrollAndCollectLinks();