Shadez
Shadez

Reputation: 51

How to get information from facebook using python?

I've looked at a lot of questions and libs and didn't found exactly what I wanted. Here's the thing, I'm developing an application in python for a user to get all sorts of things from social networks accounts. I'm having trouble with facebook. I would like, if possible, a step-by-step tutorial on the code and libs to use to get a user's information, from posts to photos information (with the user's login information, and how to do it, because I've had a lot of problem with authentication).

Thank you

Upvotes: 5

Views: 16214

Answers (2)

jsalonen
jsalonen

Reputation: 30531

I strongly encourage you to use Facebook's own APIs.

First of all, check out documentation on Facebook's Graph API https://developers.facebook.com/docs/reference/api/. If you are not familiar with JSON, DO read a tutorial on it (for instance http://secretgeek.net/json_3mins.asp).

Once you grasp the concepts, start using this API. For Python, there are at several alternatives:

I would suggest you to check out the Python libraries, try out the examples in their documentation and see if they are working and do the stuff you need.

Only as a last resort, would I write a scraper and try to extract data with screenscraping (it is much more painful and breaks more easily).

Upvotes: 3

sans
sans

Reputation: 2199

I have not used this with Facebook, but in the past when I had to scrape a site that required login I used Mechanize to handle the login and scraping and Beautiful Soup to parse the resulting HTML.

Upvotes: 1

Related Questions