I am using the following code to login to facebook .
import http.cookiejar
import urllib
url = 'https://www.facebook.com/login.php'
values = {'email' : 'john@example.com',
'pass' : 'mypassword' }
data = urllib.parse.urlencode(values)
cookies = http.cookiejar.CookieJar()
opener = urllib.request.build_opener(
urllib.request.HTTPRedirectHandler(),
urllib.request.HTTPHandler(debuglevel=0),
urllib.request.HTTPSHandler(debuglevel=0),
urllib.request.HTTPCookieProcessor(cookies))
binary_data = data.encode('ascii')
response = opener.open(url, binary_data)
the_page = response.read()
http_headers = response.info()
But when I am behind a corporate Proxy firewall , The request always time out . Can You please get me a solution to authenticate through the proxy so that the request reached the remote facebook server .