kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.35k stars 626 forks source link

How to get Comments and reactions ? #132

Closed nassera2014 closed 3 years ago

nassera2014 commented 3 years ago

Hello, Thank you so much for your great work, i get posts , but i failed to get comments of posts ? and reactions ? can you help me pleaase !! i get this error when i try to get reactions : _more_info_post = extractors.extract_reactions(post) AttributeError: module 'facebook_scraper.extractors' has no attribute 'extractreactions'

when i execute this code : _for post in get_posts('fanpage'): more_info_post = fetch_share_and_reactions(post) print(more_infopost)

Thank you, this is my email : nassera.habbat@gmail.com.

GintamaYu commented 3 years ago

that function is for internal use only, the comment for usage in code is old version you need to add a parameter in get_post, which is extra_info

gonzalo-gongora commented 3 years ago

that function is for internal use only, the comment for usage in code is old version you need to add a parameter in get_post, which is extra_info

Where do I have to add the 'extra_info' line? Do I have to modify any file from the facebook-scraper folder?

GintamaYu commented 3 years ago

for example: for post in get_posts('nintendo', pages=1,extra_info=True) but sometimes it doesn't work properly, like sometimes I can only get reactions from a post that includes video, and idk why

nassera2014 commented 3 years ago

Thank you for your response, yes i arrived to collect reactions using 'extra_info' parameter,,but i need the comments for each post , do you have any idea how can i extract them ? thank you.

gonzalo-gongora commented 3 years ago

for example: for post in get_posts('nintendo', pages=1,extra_info=True) but sometimes it doesn't work properly, like sometimes I can only get reactions from a post that includes video, and idk why

The extra_info starts acting up when analyzing long sets of data for me. The CLI usage is also funky when I try to create a .csv for data sets > 5 pages

GintamaYu commented 3 years ago

Thank you for your response, yes i arrived to collect reactions using 'extra_info' parameter,,but i need the comments for each post , do you have any idea how can i extract them ? thank you.

I think this is the most helpful one https://github.com/rugantio/fbcrawl its good at crawling comments, but its crawling post functions is kinda broken

neon-ninja commented 3 years ago

As of https://github.com/kevinzg/facebook-scraper/pull/194 and https://github.com/kevinzg/facebook-scraper/pull/188 this is now possible