作者:e26462510 | 来源:互联网 | 2023-10-10 16:49
from urllib import parse
host = ‘http://api.nnzhp.cn/‘
login_url = ‘/api/login‘
goods_urls = ‘/api/goods‘
new_url = parse.urljoin(host,login_url) # 拼url
result = parse.unquote_plus(‘https://www.baidu.com/s?wd=%E7%99%BE%E6%B5%8B‘) # url解码
s = parse.quote_plus("https://www.baidu.com/s?wd=今天中午吃什么") # url编码
url拼写+url编码