kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.38k stars 627 forks source link

Scraper returning empty json #433

Open azimjiwani opened 3 years ago

azimjiwani commented 3 years ago

Hey! I've been using your scraper and it's been working great! Recently, it has been returning an empty json although new posts are being posted in the group. Here's my code and error:

from facebook_scraper import get_posts
from pprint import pprint  `
import requests
import json
from datetime import datetime

data = []
for post in get_posts(group=1028477820535630, pages=10,timeout=60, options={"allow_extra_requests": False}):
    if post.get("listing_title"):
        data.append(post)

data[0]

Output:

IndexError                                Traceback (most recent call last)
<ipython-input-7-88bee9e22b19> in <module>
     10         data.append(post)
     11 
---> 12 data[0]

IndexError: list index out of range
neon-ninja commented 3 years ago

Try pass cookies as per the readme