python中如何http中‘%3A%2F%2F’转译成https://url/&TIME=Fri

本文展示了一个使用Python的urllib库进行URL解码的具体实例。通过两次调用unquote函数,将包含特殊字符和编码的URL字符串转换为易读的形式。最终输出的字符串清晰展示了原始URL中的参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

from urllib.parse import unquote
html_str = unquote("https://url/login_data.php?username=user&categoryid=0&URL=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Furl%2F%26TIME%3DFri%2520Aug%252005%25202016%252011%3A40%3A14%2520GMT%2B0530%28India%2520Standard%2520Time%29")
html_str = unquote(html_str)
print(html_str)

输出结果:

https://url/login_data.php?username=user&categoryid=0&URL=https://url/&TIME=Fri Aug 05 2016 11:40:14 GMT+0530(India Standard Time)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值