获取网页中的charset
m = re.compile('<meta .*(http-equiv="?Content-Type"?.*)?charset="?([a-zA-Z0-9_-]+)"?', re.I).search(response_text)
if m and m.lastindex == 2:
charset = m.group(2).lower()
m = re.compile('<meta .*(http-equiv="?Content-Type"?.*)?charset="?([a-zA-Z0-9_-]+)"?', re.I).search(response_text)
if m and m.lastindex == 2:
charset = m.group(2).lower()