Okay well I try to login into facebook using python. but well it doesn't work and I've really no idea why
By google I found this result for logging into a website
unfortunately it does not work for me...
It seems to be that there is going something wrong with the cookies, because facebook says to me that cookies aren't turned on when I print the source of the first fetch of the webpage.
I'm using python 3.1
and this is the code I use...
from http import cookiejar
from urllib import request, parse
if __name__ == '__main__':
urlLogin = 'http://www.facebook.com/login.php'
id = 'my.email'
passw = 'my.password'
fieldId = 'email'
fieldPass = 'pass'
cj = cookiejar.CookieJar()
data = parse.urlencode({fieldId:id, fieldPass:passw})
opener = request.build_opener(request.HTTPCookieProcessor(cj))
request.install_opener(opener)
usock = opener.open(urlLogin, data)
pageSource = usock.read()
usock.close()
print(pageSource)
usock = opener.open('http://www.facebook.com/home.php')
pageSource = usock.read()
usock.close()
print(pageSource)