facebook-scraper
facebook-scraper copied to clipboard
number of posts stuck at 20
Hello
I tried to scrap a group facebook. It is this groupid : https://www.facebook.com/groups/353587895099778/. It is a public group.
there is my code
for post in get_posts(groups/353587895099778/, pages = 10, cookies='facebook_cookies.txt', options={"posts_per_page":200, "allow_extra_requests": True, "progress":True}): listpost.append(post) listlike.append(post['likes']) listcomments.append(post['comments'])
I can't get more than 22 posts back, no matter how much I change the settings.
Who has an idea?
Same issue here. 20 posts seems to be the default number of posts shown then when you get to the bottom it asks to "See More Posts..." which I don't believe it used to.
You need to tell the scraper you want to scrape a group, by passing the group ID with the group parameter. Also, posts_per_page has no effect for Groups, that only works for Pages. Like so:
posts = list(get_posts(group=353587895099778, pages = 10, options={"allow_extra_requests": False}))
print(len(posts))
This outputs 210 for me