How to get the domainname (name+TLD) from a URL in python

后端 未结 4 746
温柔的废话
温柔的废话 2021-01-14 04:51

I want to extract the domain name(name of the site+TLD) from a list of URLs which may vary in their format. for instance: Current state---->what I want

mai         


        
4条回答
  •  长情又很酷
    2021-01-14 05:35

    There is a public list of TLD and CC TLD that is maintained.

    This python project reads this list and compares your URL against this list.

    https://github.com/john-kurkowski/tldextract
    

提交回复
热议问题