Closed Joshuahuang55 closed 11 months ago
@Joshuahuang55 Thanks,
I have updated my repo (this one) to fix the error you mentioned with the KeyError
. and found an issue with the page cursor having old regex. It should get all the pages now.
Still having only 8 posts on a private groupe after pip install --force-reinstall --no-deps git+https://github.com/moda20/facebook-scraper.git@master
@moda20 Thanks!! I can get all pages now. So appreciate!!
@Cartasiane You have to join the private group and adjust your code.
And then you need to assert "group" parameter to tell the code you want to scrap "group". So you can get more than 8 posts.
from facebook_scraper import get_posts
for post in get_posts(group = '817620721658179', base_url="https://mbasic.facebook.com/groups",
start_url="https://mbasic.facebook.com/groups/817620721658179?v=timeline",
pages=50,
cookies = "www.facebook.com_cookies.txt"):
print(post['text'][:50])
Ok, this work for me but even if I'm not in verbose mode the script is printing using extra page processor
for every page... Might be nice to remove this!
@Cartasiane yes, i have udpated the repo to remove that extra print
@Cartasiane @Joshuahuang55 i am closing this issue since it's resolved
Hi, thanks for providing the new way to get the posts.
There are some problems show up:
""" File ~\anaconda3\Lib\site-packages\facebook_scraper\extractors.py:108 in init self.scraper = kwargs['scraper']
KeyError: 'scraper'
"""
Is there any other way to fix this problem? Thanks a lot.
Here is the code that I can only get 8 posts in a group: