import urllib.request
import re
content = urllib.request.urlopen("http://www.open-open.com/")
x = str(content.info())
match = re.search('charset=(?P<charset>//w*)', x, re.IGNORECASE)
if match:
temp = x.decode(match.group('charset'))
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/8505.html