import chardet import urllib.request url=‘http://stock.sohu.com/news/‘ html = urllib.request.urlopen(url).read() chardit1 = chardet.detect(html) print(chardit1[‘encoding‘])
时间: 2024-10-15 05:18:14
import chardet import urllib.request url=‘http://stock.sohu.com/news/‘ html = urllib.request.urlopen(url).read() chardit1 = chardet.detect(html) print(chardit1[‘encoding‘])