Possible Duplicate:
get site name from a URL in python
For URLs like this:
http://twitter.com/pypi
http://www.wolframalpha.com/input/?i=python
I'd like to pull out the 'http://twitter.com' or 'http://wolframalpha.com' parts.
The following code works, but I'm looking for suggestions of a cleaner way of doing it...
'/'.join(url.split('/',3)[:3])