Scraping Facebook Search Results



Document image

How To Extract Leads From Facebook Search?

Today we will build a recipe to find local shops and extract the following business data:

  • Business name
  • Phone number
  • Facebook email
  • Find their website
  • Find additional phones on their site
  • same for contact emails
  • check for their website technology (WordPress and so on)

Here's the workflow outline (double-click images to zoom in):

Document image

In the end, we will gather all this data in a nice Google sheet.

Document image

First, let's find some friendly restaurant pages in New York. I am starving:



This is a generic search, but we could refine the filters by adding other filters like shops, location, and category:

Document image

Technically, Facebook limits allow us to scrape

  • Unlimited page URL search BUT
  • Only 15 execution hourly
Document image



A bit of maths: (15 potential leads per hour) x (24 hours a day) x 365 days =131400 potential leads per year for one Facebook account! Nice 🤪.

But in reality, it will be less. Still enough to find nice spots to prospect and eat NY Pastas for life.

Building The Automation Workflow

Document image

Step 1: Extract Facebook Page Search Results







Document image
Document image



Step 2: Extract Facebook Company Details Listed On Search Results



Document image
Document image
Document image

Add the "link" variable (the business page URL from the previous search). Here we will visit and load each restaurant Facebook company page from search results and scrape their details:

Document image



Step 3: Extract Website Emails and Phones



Document image

Add "Max Depth" level to 2 or 3 to crawl website directories to find emails and phones from websites. Generally, you can find this information on the website footer.

Document image

Add the "website" variable in the "WEBSITE URL" field:

Document image



Step 4: Find The Website Technologies In Use (CMS, plugins, Frameworks)



Document image

To filter only the websites using WordPress, we will use a filter as follows:

  • If technology name
  • Text contains
  • "wordpress" (keep it wrapped around quotation marks)
Document image



Step 5: Send The Data To Google Sheets



Here we will consolidate all the data we found at each step of our automation recipe and send this to a Google Sheet.

Create a new Sheet:

Document image

Set its sharing permission as "Editor" and copy the Sheet link:

Document image

Here's the header template we will use:

Document image

Map each column on our Google Spreadsheet by cheery picking the variables you need to output on it:

Document image
Document image

Let's launch that recipe. I am hungry, dammit!

Document image

Logs showing the automation processing in real-time:

Document image

Sample data running 15 minutes (slowly to fly under FB police radar). This limit is hardcoded by default in TexAu for obvious safety reasons.

You might see an #ERROR in the phone column number. Don't worry. The phones are present. It's just a formatting issue. Let's fix that cheese in my pasta:

Document image

Click the column, do CTRL+F search-replace, and check "Also search within formulas". Done.

Oh, I see on the right column that 230 Fifth Restaurant in NYC has a WordPress site. Let's see if it's correct.

Document image

Oh yeah, excellent WordPress pasta.

Document image

Enjoy.



Updated 14 May 2022
Did this page help you?
Yes
No