print(res) import re list = re.findall(r‘\>(.*)\<‘, res) # 提取bytes文本,预防含有特殊字符 print(list) print(type(list[0])) for i in range(len(list)): if "\\" in list[i]: list[i] = str(eval("b‘"+list[i]+"‘"), encoding=‘utf-8‘) # eval将bytes字符解析出来,再转换为str print(list)
原文:https://www.cnblogs.com/banyanisdora/p/14385899.html