kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.29k stars 616 forks source link

Found an issue when scraping. [Comment Count] #236

Closed fashan7 closed 3 years ago

fashan7 commented 3 years ago

When the post has more than 1000 (1k) comments, it returns the count of the comment to 0

{"comments":0, "shares":0 }

Don't know why shares count too got 0

https://m.facebook.com/story.php?story_fbid=1518534238484719&id=144655535872603

Please check this @kevinzg and @neon-ninja .

neon-ninja commented 3 years ago

Hi, https://github.com/kevinzg/facebook-scraper/commit/dedb0dadc8b04d285ad6a1da4167902e9fa1926e should fix this

neon-ninja commented 3 years ago

posts = list(get_posts(
    "XeAgoraAguenta",
    page_limit=4,
    cookies="cookies.txt"
))
for post in posts:
    if post["comments"] > 1000:
        print(post["post_id"], post["time"], post["likes"], post["shares"], post["comments"])

outputs:

1519475971723879 2021-05-02 06:03:58.665175 13000 369 1400
1519283001743176 2021-05-02 00:04:01.888480 12000 227 1100
1519225995082210 2021-05-01 23:04:04.386638 12000 975 2700
1518844515120358 2021-04-30 22:37:00 11000 815 2200