2010-05-08 84 views

回答

0
import urllib2 

r = urllib2.urlopen('https://graph.facebook.com') 
print r.info() 
html = r.read() 
0

使用libhttp2

import httplib2 
h = httplib2.Http(".cache") 
resp, content = h.request("https://graph.facebook.com/", "GET") 


>>> import httplib2 
>>> h = httplib2.Http(".cache") 
>>> resp, content = h.request("https://graph.facebook.com/", "GET") 
>>> print resp 
{'status': '200', 'content-length': '26244', 'content-location': 'http://developers.facebook.com/docs/api', 'transfer-encoding': 'chunked', 'set-cookie': 'PHPSESSID=d3cc7702c0fa0ea30eb9fd82cd93aa10; path=/, datr=1273298829-77768393a90862aba5e814235278103be75902e4150eea9368624; expires=Mon, 07-May-2012 06:07:09 GMT; path=/; domain=.facebook.com', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'server': 'Apache/1.3.41.fb2', 'connection': 'close', '-content-encoding': 'gzip', 'pragma': 'no-cache', 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'date': 'Sat, 08 May 2010 06:07:09 GMT', 'p3p': 'CP="DSP LAW"', 'content-type': 'text/html; charset=utf-8'} 
+0

這是HTTPS? (安全) – TIMEX 2010-05-08 06:07:47