Source

owen&yufei / 234 / urllib2_douban.py

The default branch has multiple heads

Full commit
#!/usr/bin/env python
#coding=utf-8
import urllib2

url = 'http://douban.com'

#下载页面
f = urllib2.urlopen(url)
data_web = f.read() 
f.close()

#保存页面
f = open('h1.html', 'w')
f.write(data_web)
f.close()