Text processing of an HTTP link in Python
<p>Imagine that I have url</p>

<pre><code>http://www.google.com/subdomain/blah-blah.../.. /..
</code></pre>

<p>So I want to extract 4 things from this
1) The Protocol: "http"
2) "www"
3) domain name : google"
4) "com" portion
5) subdomain par: all those after .com part
But as you can see this link can be anything</p>

<pre><code>ftp://google.net/hola-hola
</code></pre>

<p>now this might also be a valid link.
So how do I extract these various portions of url using python</p>
