kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.47k stars 635 forks source link

Feature Request: request_url_callback with get_friends, get_followers and get_following #747

Open Vanguard-52236 opened 2 years ago

Vanguard-52236 commented 2 years ago

Questions:

neon-ninja commented 2 years ago

Hi! Could you please clarify a bit what you mean by this? Follower/following extraction is handled here: https://github.com/kevinzg/facebook-scraper/blob/9f184edf4fd726a15d8b33ae9dbd47d670092c9a/facebook_scraper/facebook_scraper.py#L459 As you can see, these just call the function get_collection, either with f'/{account}?v=followers' or f'/{account}?v=following'. There's nothing stopping you from calling this function yourself, like so:

from pprint import pprint
from facebook_scraper import _scraper
pprint(list(_scraper.get_collection(f'/rachellouiseflood?v=followers', limit=1)))

Are you asking for this functionality to be exposed in a nicer way? Like functions called get_followers and get_following, that you could call without having to call get_profile? That could be imported from facebook_scraper.

Yes, request_url_callback is supported by get_friends. See https://github.com/kevinzg/facebook-scraper/blob/9f184edf4fd726a15d8b33ae9dbd47d670092c9a/facebook_scraper/facebook_scraper.py#L195