kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.45k stars 633 forks source link

get_posts() not working #955

Open jhPY opened 1 year ago

jhPY commented 1 year ago

I've trying an easy example to test get_posts() but it doesn't seem to work. I've download my Facebook cookies using Get Cookies.txt (Chrome) and checked that it includes c_user and the xs cookie. This is my code:

from facebook_scraper import get_posts

for post in get_posts(group=groupInteger,cookies="myfacebook_cookies.json"): print(post)

SajawalFareedi commented 1 year ago

I've trying an easy example to test get_posts() but it doesn't seem to work. I've download my Facebook cookies using Get Cookies.txt (Chrome) and checked that it includes c_user and the xs cookie. This is my code:

from facebook_scraper import get_posts

for post in get_posts(group=groupInteger,cookies="myfacebook_cookies.json"): print(post)

This is how you use the get_posts(...) function:

from facebook_scraper import get_posts

for post in get_posts(group=groupInteger, cookies="/full/path/to/myfacebook_cookies.json"): # You can also provide .txt instead of .json
    print(post)

I hope this will solve the problem. Let me know if you've any questions!