Hi I am using this code to get the data from the timeanddate.com site. But I need to do the same for my facebook accout using my username and password & grab the comments on my wall and write it to text file. Can I do this with python? How to do that?
import urllib2
from BeautifulSoup import BeautifulSoup
soup = BeautifulSoup(urllib2.urlopen('http://www.timeanddate.com/worldclock/astronomy.html?n=78').read())
for row in soup('table', {'class' : 'spad'})[0].tbody('tr'):
tds = row('td')
print tds[0].string, tds[1].string
Thanks....
requestsmodule andBeautifulSoupfor screen scraping. I've never used authentication so far, but ifrequestsis not enough, you could always emulate a browser, e.g. withmechanize, or use the API as said.