def join_url_dir(url, *args):
 for path in args:
  url = (url.rstrip('/') + '/')
  url = urljoin(url, path.lstrip('/'))
 return url

def join_url_dir ( url , * args ) : for path in args : url = ( url . rstrip ( '/' ) + '/' ) url = urljoin ( url , path . lstrip ( '/' ) ) return url
join a url with multiple directories .