python2.7 下,对返回的html进行反转义:
例子:
34;:false,"proTitle":"","specialKey":null,"localPadId":"FReNqAYJEkOC","title":"漏洞情报","isPublicPad":false,"clientIp":"","colorPalette":["#0d6c54","#c7983e","#fb6929","#b34f97","#18a281","#dbca34","#b66b56","#7a4271","#446769","#b7d02c","#c6023a","#cb7fb0","#6c858c","#ffb400","#822f1d","#bc69f7","#1fcd92","#918b3d","#8b8b8b","#875c89"],"lastModifyUser":"p.159038355558","userDomain":"144115232367957594","userLink":"","isUserChangeTitle":0,"createdDate":1617950617000,"userId":"p.144115232367957594","collab_client_vars":{"ver":8,"rev":1862,"client":{"upid":"DRlJlTnFBWUpFa09D","sid":"682943680901","tid":1618467806670,"sig":"fc5a7bae8696307fe9469ddd7503c0cdb2e8d76b"},"websocket":true,"apool":{"numToAttrib":{"415":["link","https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-28477"],"518":["flowid","3wpxvh"],"245":["image-height","478px"],"144":["image-height","409px"],"188":["image-blipFill-srcRect-t","0"],"345":[&#
处理:
import HTMLParser
def start():
url='***'
html=requests.get(url,headers=headers,verify=False).content
#x =
html = HTMLParser.HTMLParser().unescape(html)
print (html.encode('utf-8'))