Python urlparse — extract domain name without subdomain

前端 未结 7 838
南笙
南笙 2020-12-01 02:30

Need a way to extract a domain name without the subdomain from a url using Python urlparse.

For example, I would like to extract \"google.com\" from a f

相关标签:
7条回答
  • 2020-12-01 03:31

    For domain name manipulation, you can also use Dnspy (Disclaimer: I wrote this library)

    It helps extract domains (and domain labels) at various levels, using a fresh copy of Mozilla Public Suffix list.

    0 讨论(0)
提交回复
热议问题