用途
用于从url中提取域名
安装
pip3 install tldextract
使用
import tldextract
tld = tldextract.extract('http://news.baidu.com/')
print(tld)
# result: ExtractResult(subdomain='news', domain='baidu', suffix='com')
用于从url中提取域名
pip3 install tldextract
import tldextract
tld = tldextract.extract('http://news.baidu.com/')
print(tld)
# result: ExtractResult(subdomain='news', domain='baidu', suffix='com')