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) 编辑