kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.44k stars 632 forks source link

Unable to get reactions from facebook pages #922

Open sebassaras02 opened 2 years ago

sebassaras02 commented 2 years ago

Hello, I did a function to save the post that I am scrapping. However, sometimes I got the reactions. Almost all the times, I got in 'reactions': None. My function is the following code:

def get_post(user): a = [] for post in get_posts(user, pages=10, cookies = "file.txt", extra_info =True, options={"comments": True, "reactors": True} ): a.append(post) return a

Does anyone know how can I solve this issue?

sirreyson commented 1 year ago

In the Notes section, kevinzg states:

But in my experience, passing a Facebook account as argument:

for post in get_posts(
# arguments here
credentials = ('username', 'password'),
# more arguments here
):

will, more often than not, bring back reactions from the posts. At least more often than using a cookies file. Be warned though, Facebook will often try and lock your account due to "suspicious behaviour", it will prompt you to validate your account and/or change your password and then will let you go on your way.