Python Forum

Full Version: facebook scraping
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to scrape 100 or so facebook groups (from which my true account is in) to obtain specific data. Ive done this with other sites a lot via BeautifulSoup and if more extensive to bypass then with selenium. However im wondering if i login to my account and scrape 100 groups on a regular basis (once a day or two) via selenium, that the requests would trigger a lockdown on my account. Has anyone ever tried this?

I also know about the facebook API but it seems like a pain in the ass to use. I vaguely tried it before and there seemed to also be a lock on requests that just kicked you out when you exceeded them. Also it seems the API didnt use your account but a "bot account". In this case the bot account would not have access to all those groups?

What would be the best way to scrape facebook groups? And/or a little clarification on the process from someone who has done some facebook scraping before.
I can't speak from direct experience with scraping Facebook, but if you rate limit yourself a bit then that can help. Use randomized sleeps between requests and basically try to mimic real user behavior. I'm sure there are people who visit ~100 groups per day and are legit users that Facebook definitely doesn't want to discourage from being on the platform by limiting them.
I have have tried to scrape Facebook a couple of time not that i have needed it.
just as quick help to answer question about like here.

Look like Get/Post with eg Requests to the Graph API /{groupId}
Can get info about groups.
the more i look into the facebook API the more i hate it. Apparently since a version not too long ago, the API permissions were taken away to give you a list of all user groups in which you are a member. You can now only get a list of groups in which you are an admin of. So i have to go through and use selenium to get the group ID's anyways. It seems like their API is too restrictive. And their documentation is horrendous to someone not familiar with it and i see very little python examples of actual code usage. I could only assume because most people use selenium instead.  Tongue

using that example i get only this for a friends list
Quote:{u'data': [], u'summary': {u'total_count': 32}}
just shows the friends count, not anything else.