O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

urlparse

The urlparse module is used to manipulate URL strings such as “http://www.python.org”. The general form of a URL is “scheme://netloc/path;parameters?query#fragment”.

						urlparse(urlstring
						[,
						default_scheme
						[,
						allow_fragments]])

Parses the URL in urlstring and returns a tuple (scheme, netloc, path, parameters, query, fragment). default_scheme specifies the scheme (“http”, “ftp”, and so on) to be used if none is present in the URL. If allow_fragments is zero, fragment identifiers are not allowed.

						urlunparse(tuple)

Constructs a URL string from a tuple as returned by urlparse().

						urljoin(base, url
						[,
						allow_fragments])

Constructs an absolute URL by combining a base URL, base, with a relative URL, url. allow_fragments has the same meaning as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required