Extracting real-domain-name (without sub-domains) from a given URL

S.Selvam Siva s.selvamsiva at gmail.com
Tue Jan 13 08:46:31 CET 2009

Hi all,

  I need to extract the domain-name from a given url(without sub-domains).
With urlparse, i am able to fetch only the domain-name(which includes the
sub-domain also).

  http://feeds.huffingtonpost.com/posts/ , http://www.huffingtonpost.de/,
.... all must lead to *huffingtonpost.com or huffingtonpost.de**
Please suggest me some ideas regarding this problem.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090113/c5c06233/attachment.html>

More information about the Python-list mailing list