kevinzg/facebook-scraper

Issue template

neon-ninja opened this issue · 0 comments

If you're reporting a bug, please include a minimal working example (MWE, reprex) to reproduce the bug. The code should include the account or post ID that you're having the problem with, and should be runnable. Use python syntax highlighting as per https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting (```python). Please also enable debug logging as per the below example. Include the output in your issue. Please also include which version of facebook-scraper you're using. You can use pip freeze | grep facebook-scraper to check. Example:

When using the below code to fetch a post, comments and likes are incorrectly returned as 0. I am using the latest master branch as at commit 168a245.

from facebook_scraper import get_posts, enable_logging
import logging
import pprint
enable_logging(logging.DEBUG)

for post in get_posts(post_urls=[306426417518211]):
    print(f"Comments: {post.get('comments')}, Likes: {post.get('likes')}") # Both comments and likes are 0

Output:

Requesting page from: https://m.facebook.com/306426417518211
Got exact timestamp from publish_time: 2021-04-26 07:00:00
[306426417518211] Extract method extract_link didn't return anything
Fetching https://m.facebook.com/story.php?story_fbid=306426417518211&id=100044525645708
[306426417518211] Extract method extract_factcheck didn't return anything
[306426417518211] Extract method extract_share_information didn't return anything
Comments: 0, Likes: 0