Open timsayshey opened 2 years ago
Try without set_user_agent and/or import json.
import time from facebook_scraper import get_posts, set_user_agent pages = [ '205332729555617' ,'195392310760' ] for pageID in pages: for post in get_posts(pageID, pages=1, cookies='/mnt/storage/Dropbox/Apps/Instamemes/cookies.txt'):
print('POST_ID: ' + str(post['post_id'])) print('URL: ' + str(post['post_url'])) print('LIKES: ' + postlikes) print('LINK: ' + str(post['link'])) time.sleep( 2 )
Thanks @lgjluis - Unfortunately it's not printing anything. I'm just getting the following:
/home/tim/.local/lib/python3.10/site-packages/facebook_scraper/facebook_scraper.py:912: UserWarning: Facebook says 'Unsupported Browser'
warnings.warn(f"Facebook says 'Unsupported Browser'")
sys:1: UserWarning: A low page limit (<=2) might return no results, try increasing the limit
Hi Tim;
Can you send me your code? I'll check where the error is. My email lgjluis@gmail.com.
@lgjluis - I'd be happy to send you my code but already provided it. I'd just be sending you what I pasted up above. And the error I just posted was what I got after running the code you provided. The only thing I haven't posted is my cookies file.
see #858 the fix that did it for me was installing version 0.2.59: "pip install facebook-scraper==0.2.59"
@TRStrange Does my code work for you? Because I tried 0.2.59 and I'm getting the same issue.
I updated my cookie.txt file as Well, but I have a slightly different configuration than you (no user agent setup)
I'm using the latest code from the master branch and getting the following error. I've also included the code to reproduce this.
Here's my error:
And here is my code:
Any ideas?
Thanks!