Alex Martelli aleax at
Sun Jan 29 20:14:13 CET 2006

jonas.bruechner at <jonas.bruechner at> wrote:

> Hi
> Iam new in Python.
> I want to know for my first Project in Python how i can get the
> Hostname from a URL?

>>> import urlparse
>>> urlparse.urlsplit('')
('http', '', '/zapzap', '', '')

As you may notice, the hostname is the second item of the tuple result.

> Thanks for Help

You're welcome.


More information about the Python-list mailing list