- 论坛徽章:
- 0
|
使用urllib2
response = urllib2.urlopen('http://www.163.com')
print response.info()
输出内容如下:
Date: Mon, 29 Sep 2008 05:07:42 GMT
Server: Apache
Vary: Host,Accept-Encoding
Set-Cookie: _kb_track=222.173.95.53.1222664862177182; path=/; expires=Sat, 28-Mar-09 05:07:42 GMT; domain=.koubei.com
Set-Cookie: JSESSIONID=1A23BDE6352F1274F724F16AFD2D2F96; Domain=koubei.com; Path=/
Set-Cookie: last_visit_fang_new=1_1805_r5d765f154cb44692b152499cbf439cb7; Domain=koubei.com; Expires=Tue, 29-Sep-2009 05:07:42 GMT; Path=/
Content-Language: zh-CN, zh-CN
Connection: close
Content-Type: text/html;charset=GBK
但正常情况下headers头部首行还包含这个代码:HTTP/1.0 200 OK
不知道是我函数用错了,还是就这样呢????
谢谢@ |
|