Alex Rivera | Logout

Get Root Domain of Link

Asked 2009-10-05T18:16:12.743
24

I have a link such as http://www.techcrunch.com/ and I would like to get just the techcrunch.com part of the link. How do I go about this in python?

Edit
Report

1 Answer

-4

This worked for my purposes. I figured I'd share it.

".".join("www.sun.google.com".split(".")[-2:])
answered 2010-07-30T06:53:24.957

Your Answer