How To Extract Emails From Facebook

Some Information For Beginners
Facebook email list are used to create custom audiences for Facebook advertisement campaigns. A custom audience is a set of facebook users that have a common interest. To understand this, visit Apple’s official page on facebook and you will see that millions of people have liked that page. If I extract facebook emails of all those people out of that page, I can call that set of facebook emails a Custom Audience because they have a common interest, i.e. they all like apple’s products. Advertisements run using custom audience are highly targeted and cost very less as compared to facebook’s traditional targeting options. Therefore, the custom audience in above example will respond very well to ads related to Apple products for example: Iphone covers, Macbook sleeves etc.
In this tutorial we are going to learn how to extract Facebook user IDs or emails without use of any paid software. Using this method we will be able to extract user emails from facebook groups only. The method is simple and does not require any special skills or tools. Follow these simple steps to scrape:

Step 1 – Finding Relevant Groups

You can find groups related to almost anything on FB. Just write the following search term in the search bar that appears on the top most blue horizontal menu bar:

“Groups named Your Niche”

Replace “your niche” in the above search term with whatever your niche is and press enter. For example: “Groups named Apple” or “Groups named Apple products”.

Step 2 – Selecting Groups

From the search results, locate large groups that have 5000+ members. Right click on such a group and open it in new tab. If you don’t have big groups in search results you can open smaller ones in new tab as well. This will only slow down the speed of extracting the user IDs.

Step 3 – Finding Members of The Group

Click on the tab of new group. On the right side of the group as shown in the image below there is a link with total number of group members and new group members. Click on that link to see all the members of the group.

How to scrape facebook emails

Facebook will only show a few dozens of members instead of showing you all the members. Scroll to the end of the page and click on the button that says “See More”. It will load a few more dozens. Continue doing this until all the users have been displayed and the button does not appear any more.

Step 4 – Extracting Profile Links Of Members

Right click anywhere on the page and click on “Inspect Element”. This will open a pop under sort of window. In that window click on “console” (Underlined with red in the figure).

Capture

After opening console paste the following code in it and press enter (Please share using available options to unlock the code):

urls = $$('a'); for (url in urls) console.log ( urls[url].href )

It will take some time and fetch all the urls on the page to the console (including urls to the profiles of all the members). Larger groups take more time therefore; it may lag your PC for a while. Stay calm and let the process finish. Once the process is finished select all the text that has just appeared in the console and paste it in a new MS Word document.

Step 5 – Deleting Useless URLs

Now we have all the profile urls of members along with a lot of other urls and texts that we do not need. A profile url has one of the following two forms:

2VM1527:2 https://www.facebook.com/ cathy.borgeson ?fref=grp_mmbr_list

2VM1527:2 https://www.facebook.com/profile.php?id= 100007967808354 &fref=grp_mmbr_list

The highlighted part of the above urls is the only thing that we need. 1st url contains the username while the second one contains numeric user IDs. Find where the profile urls start in the word document. See this:

uid

You will have to scroll down a little to locate the start if profile urls. Delete everything before it. Same is the case in the end where there are a lot of garbage urls, delete them too.

After that select the url that is repeatedly appearing between profile urls for example:

VM1527:2 https://www.facebook.com/groups/ 388497611179690 /members/#

The highlighted number is unique for every group therefore, it will be different for the group you are working with. Select and copy that url, press Ctrl + F, click on replace tab, paste the copied url in “Find what” field and leave the other field blank. Click on “replace all” button. All the urls between profile urls will disappear.

Step 6 – Extracting User IDs From Profile Urls

Now we have only profile urls left in the document from which extra parts are to be cleaned. Press Ctrl+F and click on “Replace” tab. Paste the following in the “Find what” field and leave the “Replace with” field empty. Click on Replace all.

2VM1527:2 https://www.facebook.com/

Now again press Ctrl + F and open “Find and Replace” tab. Paste following in the Find what field and keeping the Replace With field blank, click on “replace all” button.

?fref=grp_mmbr_list

Do the same drill again by pasting “profile.php?id=” in the Find what field and click on “Replace all”.

Repeat the same drill again by pasting “&fref=grp_mmbr_list” in the “Find what” field and click on “Replace all”.

Now we will be left with user IDs of all the members of the group. Most of the user IDs here are not numerical but some are.

Step 7 – Converting User IDs To Emails

Go to http://textmechanic.com/Remove-Empty-Lines.html.

Select all the text from word document and paste it on the page we opened in the browser. And click on “Remove Empty Lines” button to remove all the empty lines. Select and copy all the text from results field.

Next go to http://textmechanic.com/Add-Prefix-Suffix-to-Text.html and paste all the text copied from above step in to the “Input Box” field. Write “@facebook.com” in the “Add Suffix” field and click on “Add Prefix And/Or Suffix”. Select all the text from “Output” field and paste in a new word document.

Voila! We have gathered user emails of a set of people interested in our niche. You can create a custom audience in facebook with these emails and start your facebook ads campaigns with them. If you found this tutorial difficult to understand following is a video tutorial about how to extract user email from Facebook.

20 comments

  1. I would like the video on this tutorial, I did find it easy up until the point where i had to cipher the url’s and unwanted stuff on the text document. any help would be appreciated.
    Thanks

  2. looks like no use in getting the email id as per facebook new tos, custom audience can’t be used by @facebook.com emails already.. any new suggestion on this?

    1. Hey Doe, I just checked on facebook and it allowed me to use my previously uploaded custom audience (list of FB emails) and also allowed me to upload new one. Did you try doing that?

  3. I tried till the copy of the thing /text on new word file. Post that it was confusion. Where to start removing and what. Tried few times..but failed.
    Can you guide me plz via video or youtube link.

    Thanks in advance.
    Sanjay

    1. Hey Sanjay,
      Thanks for stopping by and dropping query. I planned to do a video on this one but since my laptop is not behaving, I have been unable to do so. Will surely do this in video once lappy behaves.

  4. Does this still work? Can we still extract email addresses from FB Groups (and also maybe Pages). I have heard that FB has now put up a block on this and it cannot be done anymore.
    Ron

  5. I got up to the point where I clicked on the “Console” tab and a big warning came up:
    ——
    “STOP! This is a browser feature intended for developers. If someone told you to copy-paste something here to enable a Facebook feature or “hack” someone’s account, it is a scam and will give them access to your Facebook account.”
    “See https://www.facebook.com/selfxss for more information”

  6. Any word on this? I really would like a method of extracting/scraping/harvesting email addr’s from Facebook. Also Twitter, and whatever other sources might be useful for promoting products.

    All these would also be good: gmail, yahoo, hotmail, aol, earthlink, Outlook, Zoho Mail, mail.com, Yandex Mail, inbox.com, gmx.com, icloud.com

    Any help? Any suggestions? Are there any softwares that you know of that work well? (I tried facebookidscraper.com and twitteridscraper.com, and as soon as I tried to install the Free Trial version my virus protector popped up a warning about W32.Trojan.)

    Ron

    1. For things like these, software come and die as these social networks patch them up quickly. I don’t know of any working software for things you mentioned up there for now. About trojan you mentioned, sometimes these alerts are false positives while in some cases may be real threats. Just try contacting other users of the software to confirm this.

Leave a Reply

Your email address will not be published. Required fields are marked *