import urllib.parse
data = {
'wd':'罗永浩',
'sex':'男',
'location':'吉林省延边'
}
a = urllib.parse.urlencode(data)
print(a)
#运行参数
wd=%E7%BD%97%E6%B0%B8%E6%B5%A9&sex=%E7%94%B7&location=%E5%90%89%E6%9E%97%E7%9C%81%E5%BB%B6%E8%BE%B9
https://www.baidu.com/s?wd=
wd=%E7%BD%97%E6%B0%B8%E6%B5%A9&sex=%E7%94%B7&location=%E5%90%89%E6%9E%97%E7%9C%81%E5%BB%B6%E8%BE%B9
https://www.baidu.com/s?wd=%E7%BD%97%E6%B0%B8%E6%B5%A9&sex=%E7%94%B7&location=%E5%90%89%E6%9E%97%E7%9C%81%E5%BB%B6%E8%BE%B9