获取网站主域名插件,获取url顶级域名方法

import tldextract
url = 'http://www.bddd.net/jd.html'
o = tldextract.extract(url)
domain = "{}.{}".format(o.domain, o.suffix)

print(domain)

猜你喜欢

转载自blog.csdn.net/haohaomax1/article/details/112601141