facebook-scraper icon indicating copy to clipboard operation
facebook-scraper copied to clipboard

facebook_scraper.py:910: UserWarning: Facebook says 'Unsupported Browser' warnings.warn(f"Facebook says 'Unsupported Browser'")

Open sinanajluan opened this issue 1 year ago • 3 comments

sinanajluan avatar Aug 24 '22 10:08 sinanajluan

import set_user_agent along with get_posts and then before you call get_posts, call set_user_agent with a more modern user agent string from your browser

Enuratique avatar Aug 24 '22 19:08 Enuratique

@Enuratique thnx for the answer... so, the default configuration is: default_headers = { 'Accept-Language': 'en-US,en;q=0.5', "Sec-Fetch-User": "?1", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8", }

the latest update in my chrome is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

can you help me please?

sinanajluan avatar Aug 25 '22 09:08 sinanajluan

set_user_agent("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36") should work

neon-ninja avatar Aug 31 '22 01:08 neon-ninja

It looks like the warning has something to do with video posts with url redirects (from what I could surmise of facebook-scraper.py line 912)

From another solution for a different issue, I used the following line and it at least ignores the warning until a better solution is found.

 import warnings
 
 warnings.filterwarnings('ignore', message="Facebook says 'Unsupported Browser'")

micjgam avatar Nov 19 '22 04:11 micjgam