kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.47k stars 635 forks source link

the tool returned false information(such as: likes, comments) #143

Open TADK2808 opened 4 years ago

TADK2808 commented 4 years ago

Hello everyone, I use this command: facebook-scraper --filename nintendo_page_posts.csv --pages 1 chelseafc --encoding utf-8 ( or nintendo) informantion about likes, comments is not true compared to on facebook.com/chelseafc (or facebook.com/nintendo). Please help!

benjamin-awd commented 3 years ago

I'm facing a similar issue -- likes and comments don't seem to match up with posts on the actual page.

kevinzg commented 3 years ago

Have you compared with the mobile Facebook version? Sometimes the regular version and the mobile one show a different number of likes and comments.

benjamin-awd commented 3 years ago

Ah okay the likes on the mobile Facebook version match up!

Comments don't seem to match though -- for example this post shows 1.2k comments but the scraper only shows 615 comments. I've cross-checked this on my mobile device.

gkovacsp commented 3 years ago

I'm facing the same issue. Both the mobile and desktop versions (opened in a browser) show the same number of likes, but it is not the same this scarper extracts. You can easily try it for example on the "facebook.com/www.sivananda.hu" page.

mhkhung commented 3 years ago

The numbers are correct if you use private window without logging into fb..

gkovacsp commented 3 years ago

I guess it means Facebook does not want to give away the numbers without a proper API access.

neon-ninja commented 3 years ago

The differences could be likes vs all reaction types, and top level comments vs top level comments + replies. The example of https://www.facebook.com/Nintendo/photos/a.120520318032430/3685238708227222 given above seems to work now:

posts = get_posts(
    post_urls=["https://m.facebook.com/Nintendo/photos/a.120520318032430/3685238708227222"],
    cookies = "cookies.txt"
)

for post in posts:
    print(post["comments"])

returns 1611