首页
IT
登录
6mi
u
盘
搜
搜 索
IT
Python URL编解码 encodeURIComponent
Python URL编解码 encodeURIComponent
xiaoxiao
2025-04-26
6
python中对URL编码
urllib包中parse模块的quote和unquote
from
urllib
import
parse
#这个是js的结果
# encodeURIComponent('中国')
# "%E4%B8%AD%E5%9B%BD"
jsRet=
'%E4%B8%AD%E5%9B%BD'
print(parse.unquote(jsRet))
#输出:中国
print(jsRet==parse.quote(
'中国'
))
#输出:True
转载请注明原文地址: https://ju.6miu.com/read-1298457.html
最新回复
(
0
)