Facebook Groups are great to build a leads database. Reach out to your competitor group members or scrape thematic groups to find prospects.
The only problem is: scraping Facebook groups will get you a lot of bad-quality leads! Groups are filled with students, interns, and other people you don't want to target.
Facebook groups are powerful but group members need to be filtered. Here is my advice: Facebook group members must be a source to find relevant people to contact, but you must not mass mail the entire group! The challenge is to enrich your Facebook leads, segment them, and then contact the relevant prospects.
Facebook is a personal social network and personal data is protected. Some email-finding tools offer to find an email from a Facebook profile but I've found the result to be disappointing. It is easier to use information from the Facebook profile to find LinkedIn profiles. LinkedIn is great for cold messaging and because it's a business social network, lookup services to get email addresses from LinkedIn profiles work great.
Using this step by step guide, you will learn:
- How to export Facebook group members into a CSV file
- How to enrich members with their LinkedIn profile URL
- How to scrape data from the LinkedIn Profiles
- How to find email addresses
- How to keep your exports up to date with new group members
- How to use a Chrome Extension to access the script quickly
Step 1: Extracting leads from Facebook Group members
Facebook is a personal network and doesn't have built-in group members export. You need a third-party tool to export your group members.
Two options:
- Use cloud extraction services like Phantombuster that run scripts on their servers using your Facebook credentials.
- Use scripts or extensions inside your web browser to scrape data when you browse Facebook.
The only way to access Facebook group members is through the "New members" listing available on the group "People" tab. Scripts and browser extensions scrape data as you scroll the page, and cloud services do the same by mimicking user behavior in their servers.
Facebook fights scraping and has protection to detect automatic scrapers. To avoid being blocked, you need to use a proxy with cloud extraction services. Still, Facebook keeps improving its protection; so be careful with automatic scraping.
In this guide, I show you how to use a web browser script to scrape data as you browse the "People" tab.
Notes
To extract data, the "People" tab must be accessible on the group page. So, the group must be public or you must be a member for private groups.
Export Facebook group members into a CSV file
To extract Facebook group members, just copy-paste the following script into Chrome Developer Console.
Notes
The source code for the Facebook group scraper is available on Github. The script reads API calls done when loading members on the web page to extract members' data.
Important - If this is the first time you open the Chrome Developer Console, you might see a Warning message and be prevented to copy/paste the text into the console. To enable copy/pasting, just write "allow pasting", and press "Enter".
Scrape Facebook group members profiles
Press 'Enter' with your keyboard to run the script. A button with the text "Download X members" appears in the bottom right on the page.
You can close the Developer Console
, your script is active 👍
On the newer versions, the leads scrapped are stored in a cache in your browser. With this cache, the data is persisted in case your browser crashes. When you refresh the page and paste the script later, the previously scrapped data will be restored. A "Reset" button is available to clear this cache and start with an empty list.
Then, go to the "People" tab from the group page. Facebook displays a list of new members with automatic loading on scroll. Scroll down to load new members.
As you scroll, the script catches Facebook API calls and stores the data. The data is stored in a cache when possible.
Export Facebook members
Click on the "Download x members" button to export the members into a CSV file.
The CSV contains 8 columns:
- Profile Id: Unique facebook identifier. Multi-digit number.
- Full Name: First name and last name concatenated.
- Profile Link: Profile URI in the format https://www.facebook.com/{{username}}. When not available, default to generic URI https://www.facebook.com/profile.php?id={{profile_id}}
- Bio: Member bio text. Can be a job title, a school name, a city, or it can be empty.
- Image Src: Profile picture URL.
- Group Id: Facebook group identifier. Multi-digit number.
- Group Joining Text: Relative time since user join the group. In the format: "Member since XX".
- Profile Type: Facebook profile type. Can be "User" or "Page".
Notes
To stop scraping members and to remove the button, just reload the web page.
Reset the cache to start anew
The member list is stored in a cache until you click on the "Reset" button. You can scrape multiple Facebook groups in a row and segment later using the Group Id field.
Or if you prefer to have a new CSV for each group, click on the "Reset" button before clicking on the "People/Members" tab.
FAQ
How many members can I extract?
Facebook shows up to 10k members on the "New members" page. Members are sorted by date added. We recommend extracting members periodically and adding them to your existing leads database. See keep your exports up to date with new group members.
How long does it take to scrape group members?
The script scans Facebook API calls as you scroll the members' page. API calls are transparent and each call loads an average of 10 new members. By scrolling for a few minutes, I successfully extracted thousands of members.
The counter doesn't increase when I scroll
The Facebook Group scraper auto discards duplicate members. If a member has been scraped, it won't be added a second time. When you initialize the script, previously scraped members are loaded from the cache. If you scrape a previously scraped group, or if you scrape a new group with members from previous groups, only the new profiles will be added.
Can my account be blocked by Facebook?
The script catches genuine API calls done inside the web page. No extra calls are performed, and no bot clicks are done. Everything happens inside your natural browsing behavior. This script is safer than other scraping applications running in the cloud and using proxy and bots to extract profiles.
That being said, always be careful and don't abuse Facebook. Avoid using fully automated scripts. If you can, use a second Facebook profile that is not your personal one.
Step 2: Find LinkedIn profiles
Do you have a CSV file with a lot of prospects? Great! Now it's time to turn it into a leads database!
Cold messaging on Facebook is spam. Facebook is a social network. I don't want to get business inquiries, and neither do your prospects.
With a prospect name and a company name (or domain), you can search for a LinkedIn profile which can be used for LinkedIn messaging or to get a business email address.
In this guide, you will learn how to enrich your Facebook prospects with their LinkedIn Profile URL using Datablist LinkedIn Profile Finder from name. This enrichment performs a Google search using the prospect's name to find a LinkedIn profile.
Create a Datablist collection and import your CSV file
Datablist is perfect to view and edit CSV files and to run actions on your data. In this guide, I'll show you how to use the "LinkedIn Profile Finder" action on your prospects. It takes a name and a keyword and returns a LinkedIn profile URL if found.
First, sign-up on Datablist and create a collection.
Click the "+" button on the sidebar to create a collection. Then, click on "Import CSV/Excel".
Upload your CSV file, create a property for each CSV column and launch the import. Check our Import Data documentation for a step-by-step process.
Clean your leads list
First, filter your collection to remove "Page" profiles and keep only leads with "User" profile type.
Then delete them.
Then, if you like a minimalist view as I do, disable non-important properties. Hide all but the "Full Name", "ProfileLink" and "Bio" properties.
Then filter your collection to remove non-professional leads. Use Datablist search feature or filters to look for the keywords "school", "university", "student", "college".
And if you run a local business, filter for bios with your city/country.
Notes
Sometimes Facebook bio is misleading. For students, bio might be "Works at {school name}". Browse your leads and remove all leads with a school name in the bio.
Extract professional information
For group members with only a name and no info about where they work, you have to rely on manual search and enrich the profiles manually. The best way is to search on Google for "{full name} site:linkedin.com/in/" and look at the profiles listed by Google.
Searching for a LinkedIn profile with just a name usually returns homonyms. Look at their profile page, and use the location, job title, photo to find the profile that can be a prospect.
Hopefully, some Facebook profiles have a bio you can use to automatically narrow the profiles.
Keep only leads with company information
To focus on B2B leads, filter profiles with a company name. To do so, filter on the bio
property and exclude members that don't have the text at
.
B2B leads usually have a bio in the format: Works at XX
, CEO at XX
, or Founder at XX
.
Important: Add a space between and after the at. Otherwise, words containing the letters at will match.
Then delete the filtered leads. And remove the filter to get your clean list.
Notes: This will remove a lot of leads from your list. And that's normal. Lead Generation is always like this: Start from a big list -> narrow it down to an interesting few. To increase the number of leads, scrape more profiles. Go to more groups etc.
Now that you have narrowed it down to show only Facebook lead profiles with a company name in their bio, you need to extract the company name from the "Bio" to use Datablist "LinkedIn Profile Finder from name".
Extract company name automatically
First, create a "Text" property with the name "Keyword". This property will be used to store the company name. With the contact name and a company name, you will run Datablist "LinkedIn Profile Finder from name" (see below).
Then, open Datablist Javascript Runner.
And copy/paste the following code (replace default script):
function runOnItem(item){
// Check for bio
if(!item.bio) return null;
// Check for "at
let parts = item.bio.split(' at ')
if(parts.length===1){ return null }
return {
keyword: parts.pop(),
}
}
This script will write the text after the string "at" to your keyword property.
Warning
This script will work only if your properties are named "bio" and "keyword". Use your property names if they are different.
Remove any existing code in the code editor before pasting the javascript code above.
Extract the remaining keywords manually
If you want to get more leads, you can process your initial full prospects list and search for specific terms. Interesting bios contain the following terms: "works", "founder", "CEO", "marketing", etc. Adapt them to your business and your Facebook language.
Notes
To edit a cell, click on it and press "Enter" to switch to editing mode.
Run the "LinkedIn Profile Finder from name" enrichment
"LinkedIn Profile Finder from name" uses search engines to find LinkedIn profiles automatically. This enrichment is available in the Datablist "Standard" plan. Click here to upgrade.
Filter your collection to show first the leads with a "Keyword" property filled. Then click on the "Enrich" button to open the Enrichments panel. Select the enrichment "LinkedIn Profile Finder from name" to open the enrichment configuration drawer.
Important
The "LinkedIn Profile Finder from name" accuracy is directly proportional to the quality of the keywords. Better target small Facebook groups with qualified people than large groups.
Then click on "Continue to outputs configuration". The enrichment takes input and generates outputs. Here the enrichment returns the LinkedIn Profile Url
, the LinkedIn Profile Title
and the LinkedIn Profile Summary
.
Click on the "+" button to add those properties to your collection.
Run "LinkedIn Profile Finder from name" by clicking the "Run on first 10 items" button. If you are happy with the results, click on "Run enrichment on all items" to process all your leads. This enrichment processes your Leads Database by chunks of 30 items.
Tips for better leads
LinkedIn is widely used in North America and Europe and less in Asia. To improve your LinkedIn profiles search, target regional groups. For example, look for groups with "European", or countries "French", "Canadian", etc.
Step 3 (Optional): Get complete profile data from the LinkedIn URLs
Google results returned with the "LinkedIn Profile Finder from name" enrichment are limited.
Datablist provides another enrichment to scrape the full LinkedIn data from a LinkedIn Profile URL!
Once you have your results, filter to keep only members with a matching LinkedIn profile.
Then, select the "LinkedIn Profile Scraper" enrichment.
Then map the property with the LinkedIn Profile URL
, it should be LinkedIn Page
. Datablist does some auto-mapping. But it might map it with the Facebook URL as it sees a link... Be sure to map the correct property.
On the next configuration screen, click on the "+" to create new properties from the results of this enrichment.
Be sure to extract at least:
- First Name
- Last Name
- Current (or last) experience company name
- Current (or last) experience company page URL - Important for the Step 3 - Bis: Get Company domain from LinkedIn Company Pages
Warning
Don't map the "Full Name" property with the Full Name from the Facebook scraping. Otherwise, Datablist might skip the items to avoid overwriting the data. Click on the "X" to ignore the output, or click the "+" to create a new empty property.
Then, you will have a full list of properties for your leads. Use them to filter bad leads or to build personalized intro texts.
Step 3 - Bis: Get Company domains from LinkedIn Company Pages
The Step 3 gives you a "Current (or last) experience company page URL". Datablist offers a simple way to get the Company Domain from the LinkedIn Company Page.
The company domain is important for the Step 4: Finding the email address!
Click on the "Enrich" button, and select the "Company Domain/LinkedIn Company Page Lookup" enrichment.
Select the "Current (or last) experience company page URL" as input.
And create a new property to store the domain.
Then run the enrichment to get domains for your leads.
Step 4: Find email addresses for Facebook Group members
If you do email marketing, you need the email address. To be clear: there is no direct way to get the email address from Facebook.
But we can use the name, the company name/domain, or the LinkedIn Profile URL to find an email address!
That is what the "Email Finder" enrichment does.
Click on the "Enrich" button and search for "Email Finder".
In the Inputs, map the First Name, Last Name, Company Name (from this step) or Company Domain (from the LinkedIn Profile Scraper).
⚠️ Notes
The results for the email finder are way better when you have the real First Name/Last Name and the Company domain. Please read our Step 3: Get complete profile data from the LinkedIn URLs if you missed it.
If you only have the Full Name
, use the Name Parser enrichment to split the name into components (First Name, Last Name, etc.).
Map the LinkedIn Profile input with the data you had from the "LinkedIn Profile Finder from name".
And create new properties to store the results. This enrichment returns two properties:
- Email - The email address
- Email Status - Deliverability info for found email. Or 'not_found' message when no email has been found.
Then, run the "Email Finder" enrichment.
Pricing Info
The Email Finder costs 25 credits per email address found. You are not charged when no email is found.
Step 5: Update collection with new members
After the first scrape of Facebook group members, keep monitoring new members once in a while and update your Datablist collection.
Datablist lets you define a unicity constraint on any collection property. When "Do not allow duplicate values" option is enabled, duplicate rows will be skipped (or merged) during CSV import.
Enable "Do not allow duplicate values" for your "Profile Id" property. Values are unique for each Facebook profile and don't change.
Export results to an Excel file (optional)
If you need to process the Facebook group members with Microsoft Excel, click the "Export" button and select "Microsoft Excel" for export format.
Store the scrapping script in a Chrome Extension
Copy-pasting the script each time on the Chrome Console is time-consuming. Good news! You can use a Chrome Extension to quickly inject the script on the page. It can be added automatically on Facebook pages, or injected on a click.
The Chrome Extension is called "Inject Code" and is available on the Chrome Extensions store: https://chromewebstore.google.com/detail/inject-code/jpbbdgndcngomphbmplabjginoihkdph
Once the Chrome Extension is installed, click to configure a new script.
Click on the "+" button to create a "Snipper (script)".
Then on the configuration page, use the following settings:
- Name:
Facebook
- URL Filter:
https://www.facebook.com/*
- Type:
js
- AutoRun: Select
on
to automatically inject the script on Facebook pages. Oroff
to add it after clicking from the extension menu. - CodeSource:
Custom Code
Click "Save".
Pin the extension to have it from your navigation bar. And this is it! Enjoy Facebook scraping.
Other Scrapers
- Scrape Instagram followers, following list and post authors for free
- Scrape WhatsApp group members for free
If you have any feedback on this guide or if you have questions, please contact us.