No description
Find a file
Eliran Gonen 0d1b5e91d5
--headless not to require args
make the required True argument redundant
2020-11-29 06:55:28 +02:00
.github Delete FUNDING.yml 2020-03-07 18:20:32 +05:00
scraper --headless not to require args 2020-11-29 06:55:28 +02:00
test Added gitgnore entries used during dev. 2020-04-14 17:06:05 +03:00
.gitignore Update .gitignore 2020-07-14 18:16:12 +05:00
credentials.yaml Move config files to root 2019-11-30 01:53:02 +01:00
input.txt Added gitgnore entries used during dev. 2020-04-14 17:06:05 +03:00
LICENSE Upgrade LICENSE 2019-11-30 01:50:54 +01:00
params.json Added gitgnore entries used during dev. 2020-04-14 17:06:05 +03:00
README.md Add --chromium & --headless optional flags 2020-10-04 11:41:43 +00:00
requirements.txt Added gitgnore entries used during dev. 2020-04-14 17:06:05 +03:00
selectors.json fix #91 update status selectors id 2020-07-19 20:10:40 +03:00
setup.py Update setup.py 2020-05-22 12:56:26 +05:00

Ultimate Facebook Scraper (UFS)

Tooling that automates your social media interactions to collect posts, photos, videos, friends, followers and much more on Facebook.





Featured by Top Security Blogs and OSINT Researchers


BlackArch Hakin9 Kali Linux Tutorials Security Online

Kitploit Kali Tools Journalist ToolBox OneHack


2nd Spot in Top Trending Python Repositories on GitHub

UFS trended among top Python repositories on GitHub for 3 consecutive weeks 🌟

Trending on GitHub


News Updates 🏆

Features 🚀

A bot which scrapes almost everything about a user's Facebook profile including:

  • uploaded photos
  • tagged photos
  • videos
  • friends list and their profile photos (including Followers, Following, Work Friends, College Friends etc)
  • and all public posts/statuses available on the user's timeline
  • NEW: Now you can scrape Facebook group posts.

Data is scraped in an organized format to be used for educational/research purposes by researchers. This scraper does not use Facebook's Graph API meaning there are no rate limiting issues.

This tool is being used by thousands of developers weekly and we are pretty amazed at this response! Thank you!🎉

For citing/referencing this tool for your research, check the 'Citation' section below.

Note 🤝

This tool uses xpaths of 'divs' to extract data. Since Facebook updates its site frequently, the 'divs' get changed. Consequently, we have to update the divs accordingly to correctly scrape data.

The developers of this tool have devoted time and effort in developing, and maintaining this tool for a long time. In order to keep this amazing tool alive, we need support from you geeks.

The code is intuitive and easy to understand, so you can update the relevant xpaths in the code if you find data is not being scraped from profiles. Facebook has most likely updated their site, so please generate a pull request. Much appreciated!

Sample

Screenshot


Usage 🔧

Installation 💻

You will need to:

git clone https://github.com/harismuneer/Ultimate-Facebook-Scraper.git
cd Ultimate-Facebook-Scraper

# Install Python requirements
pip install -e .

The code is multi-platform and is tested on both Windows and Linux. Chrome driver is automatically downloaded using the chromedriver_manager package.

How to Run

  • Fill your Facebook credentials into credentials.yaml
  • Edit the input.txt file and add profile, groups and individual group posts links as you want in the following format with each link on a new line:

Make sure the link only contains the username or id number at the end and not any other stuff. Make sure its in the format mentioned above.

Run the ultimate-facebook-scraper command ! 🚀

python scraper/scraper.py

Note: There are two modes to download Friends Profile Pics and the user's Photos: Large Size and Small Size. By default they are set to Small Sized Pics because its really quick while Large Size Mode takes time depending on the number of pictures to download.

You can personalize your scrapping needs using the command line arguments:

python scraper/scraper.py \
    --uploaded_photos True \
    --friends_photos True \
    --friends_small_size True \
    --photos_small_size True \
    --total_scrolls 2500 \
    --scroll_time 8

Note that those are the default values so no need to write them down if you're just testing or are okay with them.

Chromium

Chromium users can add --chromium True to run using the Chromium browser.

python scraper/scraper.py \
    --uploaded_photos True \
    --photos_small_size True \
    --total_scrolls 2500 \
    --scroll_time 8 \
    --chromium True

Citation 📚

If you use this tool for your research, then kindly cite it. Click the above badge for more information regarding the complete citation for this tool and diffferent citation formats like IEEE, APA etc.


Important Message ⚠️

This tool is for research purposes only. Hence, the developers of this tool won't be responsible for any misuse of data collected using this tool. Used by many researchers and open source intelligence (OSINT) analysts.

This tool will not works if your account was set up with 2FA. You must disable it before using.


Authors 👋

You can get in touch with us on our LinkedIn Profiles:

Haris Muneer

LinkedIn Link

You can also follow my GitHub Profile to stay updated about my latest projects: GitHub Follow

Hassaan Elahi

LinkedIn Link

You can also follow my GitHub Profile to stay updated about my latest projects: GitHub Follow

If you liked the repo then please support it by giving it a star !

For Future 🔮

Shoutout to geeks willing to contribute to this project. Please have a look at the UFS kanban board for a list of things to be done.

There are a lot of features that can be added to this tool like adding support for pages, groups, comments etc! Please contribute :)

Contributions Welcome

forthebadge

If you find any bug in the code or have any improvements in mind then feel free to generate a pull request.

Note: We use Black to lint Python files. Please use it in order to have a valid pull request 😉

Issues 🔨

GitHub Issues

If you face any issue, you can create a new issue in the Issues Tab and I will be glad to help you out.

License 📄

MIT

Copyright (c) 2018-present, harismuneer, Hassaan-Elahi