`urlparse.urljoin` might be helpful here