python 3.x中urllib庫和urilib2庫合並成了urllib庫。
其中urllib2.urlopen()變成了urllib.request.urlopen()
urllib2.Request()變成了urllib.request.Request()
Python3 如何對url解碼?實現Python2中urllib.unquote的作用?
Python2中,對url解碼 可以這樣做:
>>> print urllib.unquote("%E6%B5%8B%E8%AF%95abc")
python3取消unquote屬性
可以這樣做:
import
urllib.parse
print
(urllib.parse.unquote(
"%E6%B5%8B%E8%AF%95abc"
))