kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.4k stars 627 forks source link

get_posts_by_url unexpected keyword argument #867

Open Rayan-Habbab opened 2 years ago

Rayan-Habbab commented 2 years ago

Hi! I get an unexpected keyword argument when I try to get posts by URL. I've attached my code below and the output. Any thoughts would be much appreciated - also, this is my first time reporting an issue, so if I can provide any additional information / do anything better when reporting, please let me know!

from facebook_scraper import get_posts

for post in get_posts(post_urls=["https://www.facebook.com/Nintendo/"], pages=1): print(post['text'][:50])

the error:

Library/Python/3.8/lib/python/site-packages/facebook_scraper/init.py", line 232, in get_posts return _scraper.get_posts_by_url(post_urls, **kwargs) TypeError: get_posts_by_url() got an unexpected keyword argument 'page_limit'

neon-ninja commented 2 years ago

If you're passing post_urls, you can't pass pages, because it doesn't make sense. Try remove the pages argument