skip to Main Content

I try to get post data from facebook page using Facebook Graph API like this.

enter image description here

The output not show anything. So I try to use facebook-scraper like this tutorial.

from facebook_scraper import get_posts
import pandas as pd

post_df_full = pd.DataFrame(columns = [])

for post in get_posts('bbcnews', extra_info=True, pages=5, options={"comments": True}):
    post_entry = post
    print(post_entry)
    fb_post_df = pd.DataFrame.from_dict(post_entry, orient='index')
    fb_post_df = fb_post_df.transpose()
    post_df_full = post_df_full.append(fb_post_df)

I use this code to print post_entry which is the post from page but it not show anything. How to fix it?


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