from urllib import parse url=parse.urljoin("https://www.baidu.com?name='scott'","/n/123") #https://www.baidu.com/n/123