URL带中文、特殊字符的处理
百度了一番:
import urllib.request
from urllib.parse import quote
import string
url = "http://baike.baidu.com/item/史记·2016?fr=navbar";
url_ = quote(url, safe = string.printable);
response = urllib.request.urlopen(url_);
百度了一番:
import urllib.request
from urllib.parse import quote
import string
url = "http://baike.baidu.com/item/史记·2016?fr=navbar";
url_ = quote(url, safe = string.printable);
response = urllib.request.urlopen(url_);
2017-05-07
举报