微慑信息网

python2.7下HTMLparser使用

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

 

本文标题:python2.7下HTMLparser使用
本文链接:
(转载请附上本文链接)
http://vulsee.com/archives/vulsee_2021/0415_14284.html
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » python2.7下HTMLparser使用
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

微慑信息网 专注工匠精神

访问我们联系我们