使用urllib模块,urllib.unquote/urllib.quote
#coding:utf-8
import urllib
url="https://fanyi.baidu.com/#zh/en/%E7%AC%94%E8%AE%B0"
res=urllib.unquote(url)
print res
url='https://fanyi.baidu.com/#zh/en/笔记'
res=urllib.quote(url)
print res
本文标题: | URL编码URL解码 |
本文链接: (转载请附上本文链接) | https://vulsee.com/archives/vulsee_2020/0828_12261.html |