Skip to Content
Python: Essential Reference, Third Edition
book

Python: Essential Reference, Third Edition

by David Beazley
February 2006
Intermediate to advanced content levelIntermediate to advanced
648 pages
14h 53m
English
Sams
Content preview from Python: Essential Reference, Third Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python: Essential Reference

Python: Essential Reference

David M. Beazley

Publisher Resources

ISBN: 0672328623Purchase book