摘要: import chardet import urllib.request page = urllib.request.urlopen('http://photo.sina.com.cn/') #打开网页 htmlCode = page.read() #获取网页源代码 print(chardet.detect(htmlCode)) #打印返回网页的编码方式 {'encoding': 'utf... 阅读全文