skip to Main Content

I want to scrape comments from a public facebook page (news network) through the facebook graph api.
However it says i need to create a app to do this.

After a bit of research I found out that facebook prohibits web scraping since the cambridge analytica scandal.

Is there still a legal way to scrape data from facebook?
Does somebody here have experience he/she can share?
Thank you in advance.

2

Answers


  1. It is possible, but you have to create an App and apply for Page Public Content Access: https://developers.facebook.com/docs/apps/features-reference#reference-PAGES_ACCESS

    …after that, you can get the feed of a public Page with the /page-id/feed endpoint, with an App Access Token.

    Login or Signup to reply.
  2. I dont know about the legality of scraping facebook,
    but you can use a library called facebook_scraper

    for instance:

    from facebook_scraper import get_posts
    
    for post in get_posts(name_of_your_public_group, pages=10):
        print(post['text'],'n')
    

    Note: working only for public pages

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search