This is a simple python3 script used to download a user's friend list from facebook. The script uses selenium & Firefox to automate the login process and extract the data from the user's account. All you have to do is to write the email and password and the script will do all the work. Simple!
user:~$ python3 facebook_scraper.py --help
usage: facebook_scraper.py [-h] [-v] [-b] [-t TIMEOUT] [-j] [-c] [-s] [-i HTMLPAGE] [-l LOGINFILE]
Use Selenium & Firefox to automate Facebook login and scrape user's friend list.
optional arguments:
-h, --help show this help message and exit
-v, --verbose Increase verbosity level.
-b, --headless Activate headless mode, run firefox in the background.
-t TIMEOUT, --timeout TIMEOUT
Time to wait for elements to load on webpages before giving up. (30s)
-j, --json Export user's friend list in JSON format. (default)
-c, --csv Export user's friend list in CSV format.
-s, --html Export the source html page.
-i HTMLPAGE, --import-html HTMLPAGE
Import data from source html page.
-l LOGINFILE, --login-data LOGINFILE
Read login data from file.
- Python (3+). [How to install]
- BeautifulSoup4 for python3. [How to install]
pip3 install bs4
- Selenium for python3. [How to install]
pip3 install selenium
- Firefox webbrowser. [Windows, Linux, Mac]
- Geckodriver for Firefox. [How to install]
This project is licensed under the GNU GPLv3 License - check LICENSE for more details.