url拼写+url编码

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编码

posted @ 2020-03-18 14:45  面包树下的路人  阅读(256)  评论(0编辑  收藏  举报