kevinzg / facebook-scraper

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

Two warnings and an exit #470

Open anonwins opened 3 years ago

anonwins commented 3 years ago

Hi,

I can't get it to work at all.

Running the example facebook-scraper --filename nintendo_page_posts.csv --pages 10 nintendo

returns this

/usr/local/lib/python3.8/dist-packages/facebook_scraper/__init__.py:285: UserWarning: The sleep parameter has been removed, it won't have any effect.
  get_posts(account=account, group=group, remove_source=not bool(dump_location), **kwargs),
/usr/local/lib/python3.8/dist-packages/facebook_scraper/facebook_scraper.py:439: UserWarning: Locale detected as nl_NL - for best results, set to en_US
  warnings.warn(f"Locale detected as {locale} - for best results, set to en_US")
Couldn't get any posts.

And on other pages/groups it's the same.

I then changed my locale. Typing locale now returns this:

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

but the warning still says it's set to nl_NL which is not the case. Anyway, in the end it says Couldn't get any posts which is unfortunate. Anybody knows what's going on? Thanks

neon-ninja commented 3 years ago

Try pass cookies as per the readme. Locale/language would be set on your Facebook account, not your local machine