PyMOTW: urlparse

The urlparse module provides an interface for splitting up Uniform Resource Locator strings into their parts.

Read more at pymotw.com: urlparse