import sys from urlparse import urlparse for url in sys.stdin: o = urlparse(url) print o.netloc