title: Python urlparse -- extract domain name without subdomain
body: <p>Need a way to extract a domain name without the subdomain from a url using Python urlparse.</p>
  
  <p>For example, I would like to extract <code>"google.com"</code> from a full url like <code>"http://www.google.com"</code>.</p>
  
  <p>The closest I can seem to come with <code>urlparse</code> is the <code>netloc</code> attribute, but that includes the subdomain, which in this example would be <code>www.google.com</code>.</p>
  
  <p>I know that it is possible to write some custom string manipulation to turn www.google.com into google.com, but I want to avoid by-hand string transforms or regex in this task.  (The reason for this is that I am not familiar enough with url formation rules to feel confident that I could consider every edge case required in writing a custom parsing function.)</p>
  
  <p>Or, if <code>urlparse</code> can't do what I need, does anyone know any other Python url-parsing libraries that would?</p>