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

2009-01-20 Thread Aahz
In article , S.Selvam Siva wrote: > > Actually i tried with domain specific logic.Having 200 TLD like >.com,co.in,co.uk and tried to extract the domain name. > But my boss want more reliable solution than this method,any way i >will try to find some alternative solution. http://www.dnspython.or

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

2009-01-13 Thread Terry Reedy
S.Selvam Siva wrote: I doubt anyone's created a general ready-made solution for this, you'd have to code it yourself. To handle the common case, you can cheat and just .split() at the periods and then slice and rejoin the list of domain parts, ex: '.'.join(domain.split('.')[-2:]) Cheers, Chris

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

2009-01-13 Thread Steve Holden
S.Selvam Siva wrote: > On Tue, Jan 13, 2009 at 1:50 PM, Chris Rebert wrote: >> On Mon, Jan 12, 2009 at 11:46 PM, S.Selvam Siva >> wrote: >>> 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

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

2009-01-13 Thread S.Selvam Siva
On Tue, Jan 13, 2009 at 1:50 PM, Chris Rebert wrote: > > On Mon, Jan 12, 2009 at 11:46 PM, S.Selvam Siva > wrote: > > 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-d

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

2009-01-13 Thread Chris Rebert
On Mon, Jan 12, 2009 at 11:46 PM, S.Selvam Siva wrote: > 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). > > eg: > http://feeds.huffingtonpost.com/posts/ , http:

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

2009-01-12 Thread S.Selvam Siva
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). eg: http://feeds.huffingtonpost.com/posts/ , http://www.huffingtonpost.de/, all must lead to *huffingtonpost.com or