kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.42k stars 628 forks source link

KeyError: 'comments_full' #1101

Open clamalou96 opened 6 months ago

clamalou96 commented 6 months ago

I'm a very amateurish Python user who is scraping FB comments for my PhD. Very grateful for your code which I have been using pretty much with zero issues for the past year or so. But suddenly I've been getting KeyError: 'comments_full' response. I saw another thread on this from Oct 2022, which said it hadn't been fixed but I'd used it then and it worked fine. I've tried following other advice and making sure to use URLs with pfbid etc. Is there anything else to try that you'd recommend? For reference, this is the code I've been using, pretty much exactly what was originally posted:

import facebook_scraper as fs POST_ID = "[full URL, just ID didn't work for me]" MAX_COMMENTS = True gen = fs.get_posts( post_urls = [POST_ID], options = {"comments": MAX_COMMENTS, "progress": True} ) post = next(gen) comments = post['comments_full'] --> triggers KeyError

qianxuwanyu commented 2 months ago

您好,这个问题解决了吗,这对我很重要,可以回复我吗