All Projects → kevinzg → Facebook Scraper

kevinzg / Facebook Scraper

Licence: mit
Scrape Facebook public pages without an API key

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Facebook Scraper

Mullet
Mullet Stack: Facebook in the front. Walmart in the back. (React, Hapijs, Node)
Stars: ✭ 194 (-61.12%)
Mutual labels:  hacktoberfest, facebook
scrapy facebooker
Collection of scrapy spiders which can scrape posts, images, and so on from public Facebook Pages.
Stars: ✭ 22 (-95.59%)
Mutual labels:  facebook, scraping
Panther
A browser testing and web crawling library for PHP and Symfony
Stars: ✭ 2,480 (+396.99%)
Mutual labels:  hacktoberfest, scraping
Facebook
📨 Facebook Notifications Channel for Laravel
Stars: ✭ 120 (-75.95%)
Mutual labels:  hacktoberfest, facebook
Social Media Profiles Regexs
📇 Extract social media profiles and more with regular expressions
Stars: ✭ 324 (-35.07%)
Mutual labels:  scraping, facebook
Torchbear
🔥🐻 The Speakeasy Scripting Engine Which Combines Speed, Safety, and Simplicity
Stars: ✭ 128 (-74.35%)
Mutual labels:  hacktoberfest, scraping
scrap
Scrapping Facebook with JavaScript.
Stars: ✭ 25 (-94.99%)
Mutual labels:  facebook, scraping
Pastepwn
Python framework to scrape Pastebin pastes and analyze them
Stars: ✭ 87 (-82.57%)
Mutual labels:  hacktoberfest, scraping
Statusstories
Status Stories = Snapchat stories, Instagram stories, Whatsapp Statuses, Facebook Messenger Stories.
Stars: ✭ 317 (-36.47%)
Mutual labels:  hacktoberfest, facebook
Spidermon
Scrapy Extension for monitoring spiders execution.
Stars: ✭ 309 (-38.08%)
Mutual labels:  hacktoberfest, scraping
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+2065.13%)
Mutual labels:  hacktoberfest, facebook
Yii2 Authclient
Yii 2 authclient extension.
Stars: ✭ 430 (-13.83%)
Mutual labels:  hacktoberfest, facebook
Scrapy
Scrapy, a fast high-level web crawling & scraping framework for Python.
Stars: ✭ 42,343 (+8385.57%)
Mutual labels:  hacktoberfest, scraping
Educative.io Downloader
📖 This tool is to download course from educative.io for offline usage. It uses your login credentials and download the course.
Stars: ✭ 139 (-72.14%)
Mutual labels:  hacktoberfest, scraping
Sharedchamber
Android Secure SharedPreferences Using Facebook Conceal Encryption
Stars: ✭ 96 (-80.76%)
Mutual labels:  hacktoberfest, facebook
Miscord
Facebook Messenger to Discord bridge
Stars: ✭ 225 (-54.91%)
Mutual labels:  hacktoberfest, facebook
Parsel
Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors
Stars: ✭ 628 (+25.85%)
Mutual labels:  hacktoberfest, scraping
Dataengineeringproject
Example end to end data engineering project.
Stars: ✭ 82 (-83.57%)
Mutual labels:  hacktoberfest, scraping
facebook-discussion-tk
A collection of tools to (semi-)automatically collect and analyze data from online discussions on Facebook groups and pages.
Stars: ✭ 33 (-93.39%)
Mutual labels:  facebook, scraping
Socialreaper
Social media scraping / data collection library for Facebook, Twitter, Reddit, YouTube, Pinterest, and Tumblr APIs
Stars: ✭ 338 (-32.26%)
Mutual labels:  scraping, facebook

Facebook Scraper

Scrape Facebook public pages without an API key. Inspired by twitter-scraper.

Install

pip install facebook-scraper

Usage

Send the unique page name as the first parameter and you're good to go:

>>> from facebook_scraper import get_posts

>>> for post in get_posts('nintendo', pages=1):
...     print(post['text'][:50])
...
The final step on the road to the Super Smash Bros
Were headed to PAX East 3/28-3/31 with new games

Optional parameters

(For the get_posts function).

  • group: group id, to scrape groups instead of pages. Default is None.
  • pages: how many pages of posts to request, the first 2 pages may have no results, so try with a number greater than 2. Default is 10.
  • timeout: how many seconds to wait before timing out. Default is 5.
  • credentials: tuple of user and password to login before requesting the posts. Default is None.
  • extra_info: bool, if true the function will try to do an extra request to get the post reactions. Default is False.
  • youtube_dl: bool, use Youtube-DL for (high-quality) video extraction. You need to have youtube-dl installed on your environment. Default is False.

CLI usage

$ facebook-scraper --filename nintendo_page_posts.csv --pages 10 nintendo

Run facebook-scraper --help for more details on CLI usage.

Note: If you get a UnicodeEncodeError try adding --encoding utf-8.

Post example

{'post_id': '2257188721032235',
 'text': 'Don’t let this diminutive version of the Hero of Time fool you, '
         'Young Link is just as heroic as his fully grown version! Young Link '
         'joins the Super Smash Bros. series of amiibo figures!',
 'time': datetime.datetime(2019, 4, 29, 12, 0, 1),
 'image': 'https://scontent.flim16-1.fna.fbcdn.net'
          '/v/t1.0-0/cp0/e15/q65/p320x320'
          '/58680860_2257182054366235_1985558733786185728_n.jpg'
          '?_nc_cat=1&_nc_ht=scontent.flim16-1.fna'
          '&oh=31b0ba32ec7886e95a5478c479ba1d38&oe=5D6CDEE4',
 'images': ['https://scontent.flim16-1.fna.fbcdn.net'
          '/v/t1.0-0/cp0/e15/q65/p320x320'
          '/58680860_2257182054366235_1985558733786185728_n.jpg'
          '?_nc_cat=1&_nc_ht=scontent.flim16-1.fna'
          '&oh=31b0ba32ec7886e95a5478c479ba1d38&oe=5D6CDEE4'],
 'likes': 2036,
 'comments': 214,
 'shares': 0,
 'reactions': {'like': 135, 'love': 64, 'haha': 10, 'wow': 4, 'anger': 1},  # if `extra_info` was set
 'post_url': 'https://m.facebook.com/story.php'
             '?story_fbid=2257188721032235&id=119240841493711',
 'link': 'https://bit.ly/something', 
 'is_live': False}

Notes

  • There is no guarantee that every field will be extracted (they might be None).
  • Shares doesn't seem to work at the moment.
  • Group posts may be missing some fields like time and post_url.
  • Group scraping may return only one page and not work on private groups.

To-Do

  • Async support
  • Image galleries
  • Profiles or post authors
  • Comments

Alternatives and related projects

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].