Python Forum

Full Version: Scrape Facebook page user posts text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello! 

I am new to Python and looking for a solution to scrape all user posts with replies from other users and the page (text) from a Facebook page over a period of three days last year. How to do this? And anyone willing to help me? 

Greetings from a student in Stockholm.
Hey there. I'll see what I can do for you tomorrow morning once I am on my computer, but I believe I should be able to create what you want fairly easily and then submit the source code. However, scanning over what I have to work with, might require more than a day in order to balance things out properly.

All the best,

Joseph
(May-08-2017, 12:40 AM)KJoseph_f2 Wrote: [ -> ]Hey there. I'll see what I can do for you tomorrow morning once I am on my computer, but I believe I should be able to create what you want fairly easily and then submit the source code. However, scanning over what I have to work with, might require more than a day in order to balance things out properly.

All the best,

Joseph
facebook has its own API. It would be wise to scrape posts via their API verses logging in via selenium...otherwise you could find yourself blocked from facebook from repetitive requests.
(May-08-2017, 12:51 AM)metulburr Wrote: [ -> ]facebook has its own API. It would be wise to scrape posts via their API verses logging in via selenium...otherwise you could find yourself blocked from facebook from repetitive requests.
Yup, I had the API in mind. Not 100% sure how limited it might be yet. However, I know that manually attempting to extract posts from some HTML source code is a headache in itself and a last resort too.
last i recall their API would allow everything from posting on your behalf to changing settings. I personally prefer BeautifulSoup and scraping HTML as i am comfortable with it, and I hate learning API's but facebook is probably the one of the tightest places. I get banned from posting in groups when i manually do it due to posting to too many groups within X timeframe. Couldnt imagine a bot.
(May-08-2017, 03:00 AM)metulburr Wrote: [ -> ]last i recall their API would allow everything from posting on your behalf to changing settings. I personally prefer BeautifulSoup and scraping HTML as i am comfortable with it, and I hate learning API's but facebook is probably the one of the tightest places. I get banned from posting in groups when i manually do it due to posting to too many groups within X timeframe. Couldnt imagine a bot.
True, it could be fairly problematic. However, OP only wants to retrieve a user's feed from what I can tell. So providing I don't send too many query requests, I think it should be fine (fingers crossed) :)