44

GitHub - harismuneer/Ultimate-Facebook-Scraper: 🤖 A bot which scrapes almost eve...

 4 years ago
source link: https://github.com/harismuneer/Ultimate-Facebook-Scraper
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Ultimate Facebook Scraper (UFS)

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

68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3766343137393063336333613466643239323933373737633637366338363137 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275696c642d50617373696e672d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265266c6f676f3d6170707665796f72 68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f76312f6f70656e2d736f757263652e7376673f763d313033 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f68617269736d756e6565722f556c74696d6174652d46616365626f6f6b2d536372617065722e7376673f7374796c653d736f6369616c266c6162656c3d466f726b266d61784167653d32353932303030 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174266c6162656c3d436f6e747269627574696f6e7326636f6c6f72413d72656426636f6c6f72423d626c61636b


Contributors

Developers from following organizations have so far joined the quest and contributed to UFS.

Microsoft MIT Harvard NUCES
UCLA ACM LUMS


Features

A bot which scrapes almost everything about a facebook user's 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.

The best thing about this scraper is that the data is scraped in an organized format so that it can be used for educational/research purpose by researchers. Moreover, this scraper does not use Facebook's Graph API so there are no rate limiting issues as such.

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

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

Note

At its core, this tool uses xpaths of 'divs' to extract data from them. Since Facebook keeps on updating its site frequently and the 'divs' get changed. Consequently, we have to update the divs accordingly to correctly scrape the data.

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

The code is pretty intuitive and easy to understand, so you can update the relevant xpaths in the code when you feel that you have tried many profiles and the data isn't being scraped for any of them (that's a hint that Facebook has updated their site) and generate a pull request. That's quite an easy thing to do. Thanks!

Sample

main.png

Screenshot

screenshot.png


Usage

Installation

You will need to install latest version of Google Chrome. Moreover, you need to install selenium module as well using

pip install selenium

Run the code using Python 3. Also, the code is multi-platform and is tested on both Windows and Linux. The tool uses latest version of Chrome Web Driver. I have placed the webdriver along with the code but if that version doesn't work then replace the chrome web driver with the latest one.

How to Run

There's a file named "input.txt". You can add as many profiles as you want in the following format with each link on a new line:

https://www.facebook.com/andrew.ng.96
https://www.facebook.com/zuck

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.

Note: There are two modes to download Friends Profile Pics and the user's Photos: Large Size and Small Size. You can change the following variables. 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

# whether to download the full image or its thumbnail (small size)
# if small size is True then it will be very quick else if its False then it will open each photo to download it
# and it will take much more time
friends_small_size = True
photos_small_size = True

Citation

68747470733a2f2f7a656e6f646f2e6f72672f62616467652f3134353736333237372e737667

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.


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 kindly support it by giving it a star ⭐!

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.

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK