\\w*)', x, re.IGNORECASE) if match: temp = ">
 | 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
ew3y
10年前发布

python解析网页的字符编码

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'))