kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.43k stars 631 forks source link

Does it work with another languages? #399

Closed etomoscow closed 3 years ago

etomoscow commented 3 years ago

Trying to parse posts and comments for the Russian segment of Facebook. When I try to run the code below, I get HTTPError: 404 Client Error: Not Found for url: https://m.facebook.com/%D0%B6%D0%B0%D1%80%D0%B0/

for post in get_posts('жара', pages=1, options={'comments' : True, 'progress' : True, 'allow_extra_requests' : True}):
    print(post['text'][:50])
neon-ninja commented 3 years ago

That URL doesn't work for me either. Is this a page or a group? There's several pages and groups on Facebook called жара - which one did you mean? You need to pass the unique fragment from the URL

etomoscow commented 3 years ago

That URL doesn't work for me either. Is this a page or a group? There's several pages and groups on Facebook called жара - which one did you mean? You need to pass the unique fragment from the URL

That is an URL generated by my query in Russian.

neon-ninja commented 3 years ago

What query? Do you mean https://www.facebook.com/heat.public? In that case, pass "heat.public"

etomoscow commented 3 years ago

What query? Do you mean https://www.facebook.com/heat.public? In that case, pass "heat.public"

No, I mean I want to search for posts with my query. For example, I chose my search query as "жара" which is "heat" in Russian. I expected to get posts and comments as a result of search via this query.

neon-ninja commented 3 years ago

get_posts is intended for collecting posts from a given page or group. It is not a search function. The scraper does not currently support search