会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
记录一下日子的痕迹
博客园
首页
新随笔
联系
订阅
管理
2010年5月27日
python抓网页中文乱码问题
摘要: import urllib2import syscontent = urllib2.urlopen("http://www.higis.cn").read() #网站页面是utf-8编码的。type = sys.getfilesystemencoding() # 关键print content.decode("UTF-8").encode(type) # 关键
阅读全文
posted @ 2010-05-27 16:40 jerry data
阅读(4521)
评论(0)
推荐(1)
编辑