title: find network location from URL elegantly
body: <p>code:</p>
  
  <pre><code>import urlparse
  url1 = 'http://try.github.io//levels/1/challenges/1'
  netloc1 = urlparse.urlparse(url1)[1]  #try.github.io
  
  url2 = 'https://github.com/explore'
  netloc2 = urlparse.urlparse(url2)[1]  #github.com
  </code></pre>
  
  <p><code>netloc2</code> is I want,however,I hope <code>netloc1</code> is <code>github.io</code>,if  use regex,how to handle it.</p>