Skip to content

rrva/fb-search-results

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Facebook Search Results Scraper

Scrape thousands of Facebook search places results.

Facebook Graph API has a limit of 400-450 results per query so this why I have decided to make this bot and extract all results without limits.

Installation

This project requires to have Node.js installed.

Clone the repository in your machine

$ git clone https://github.com/alfonbots/fb-search-results.git
$ cd fb-search-results/

Install the needed packages

$ npm install

Add a valid Facebook.com account

$ echo "user@email.com;password" > account_data.txt

Run the app

$ node fb.js

Usage

How the bot works

I'll try to simplify how the bot works, if you want to know how it works exactly, take a look to the code.

Behavior:
The bot prompts for a target url, logins to Facebook.com with the account data from account_data.txt file, if the bot logins successfully then verifies the target url, if the target url is valid then navigates to the target url, now will scrape all current results visibles, scroll down in the page to load more results, hide the previous results scraped changing their CSS display Property class to 'none', check if endOfResultsDetected is true, if it is true (if it isn't true then will keep repeating the same actions until endOfResultsDetected is true) then will save the scraped results to a .txt file and display the total results scraped number and the duration time of the scraping operation (in milliseconds).

Debugging

There are two ways to get more information and know what's happening inside the bot.

  1. node fb.js --debug
  2. DEBUG=nightmare node --harmony fb.js --debug (on Windows use DEBUG=nightmare & node fb.js --debug)

The first option shows a window of the bot working, so you can see what's doing.

The second option does the same like the previous option but this option also will give you more depth information about the bot actions.

Disclaimer

This bot is only for educational purposes. Read Facebook.com scraping policy before use it.

About

Facebook Search Results Scraper

Resources

License

Stars

Watchers

Forks

Packages

No packages published