微慑信息网

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

 

赞(0) 打赏
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » python2.7下HTMLparser使用

评论 抢沙发

微慑信息网 专注工匠精神

微慑信息网-VulSee.com-关注前沿安全态势,聚合网络安全漏洞信息,分享安全文档案例

访问我们联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册