archive about


urlparse.urljoin(base, url[, allow_fragments])

Construct a full (“absolute”) URL by combining a “base URL” (base) with another URL (url). Informally, this uses components of the base URL, in particular the addressing scheme, the network location and (part of) the path, to provide missing components in the relative URL. For example:

>>> from urlparse import urljoin
>>> urljoin('', 'FAQ.html')

It will also work with URLs, like this

>>> urljoin('', '../../../08/30/privacy-is-not-dead/')