随笔-80  评论-1  文章-3  trackbacks-0
05 2010 档案
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 阅读(312) | 评论 (0) 编辑