Scrape facebook group member

blazeruk1

Newbie
Joined
Apr 3, 2010
Messages
16
Reaction score
40
So, hi

I do this because I have something with my facebook projects and just wanted to share a quick method I’ve been using to extract facebook group member names + profile urls directly from the browser using plain js. No extensions, no external tools, just the Chrome console

JavaScript:
// ==== CONFIG ====
const TOTAL_SCROLL = 50; // CHANGE X SCROLL
const SCROLL_DELAY = 1200; // DELAY PER SCROLL

// ==== STORAGE ====
let results = new Set();

// ==== SCRAPE FUNCTION ====
function scrapeMembers() {
  const anchors = document.querySelectorAll('a[href*="/user/"]');
  anchors.forEach(a => {
    const name = a.innerText.trim();
    const url = a.getAttribute("href");
    if (name && url) {
      results.add(`${name} - ${url}`);
    }
  });
}

// ==== DOWNLOAD RESULT ====
function downloadTXT() {
  const blob = new Blob([Array.from(results).join("\n")], { type: "text/plain" });
  const url = URL.createObjectURL(blob);
  const a = document.createElement("a");
  a.href = url;
  a.download = "fb_members.txt";
  a.click();
  URL.revokeObjectURL(url);
  console.log("✔ File downloaded: fb_members.txt");
}

// ==== AUTO SCROLL ====
let count = 0;
console.log("▶ Scrolling ...");

const interval = setInterval(() => {
  scrapeMembers();
  window.scrollBy(0, 2000);
  count++;

  console.log(`X : ${count}... total data: ${results.size}`);

  if (count >= TOTAL_SCROLL) {
    clearInterval(interval);
    scrapeMembers();
    downloadTXT();
    console.log("✔ Done!");
  }
}, SCROLL_DELAY);

Thanks to chatgpt to my make life easier :smirk:
 
Forgot to mention

Output would be
NAMEEEE - /groups/THIS_IS_GROUP_UID/user/USER_PROFILE_UID/

So you need to do like
fb/profile.php?id=USER_PROFILE_UID
 
Last edited:
scraping facebook group members isn’t allowed and will get accounts restricted facebook blocks any tools or methods that extract member data
 
scraping facebook group members isn’t allowed and will get accounts restricted facebook blocks any tools or methods that extract member data
I know peoples who do like this and use multiple accounts/proxies to make it work so it should still work
 
Back
Top