I am new to Python and it seems to have a lot of nice functions that I don\'t know about. What function can I use to get the root site name? For example, how would I get
The much overlooked urlparse module:
from urlparse import urlparse scheme, netloc, path, params, query, fragment = urlparse("http://www.faqs.org/docs/diveintopython/kgp_commandline.html") print netloc