美文网首页
python 顶级域库ip库

python 顶级域库ip库

作者: 明明就_c565 | 来源:发表于2020-06-02 10:56 被阅读0次

安装

pip install tld

获取

from tld import get_tld

get_tld("http://www.google.co.uk")

# 'co.uk'

get_tld("http://www.google.idontexist",fail_silently=True)

# None

判断

from tld import is_tld

is_tld('com)

# True

is_tld('uk')

# True

is_tld('ddd')

# False

is_tld('www.google.com')

# False

更多参考

github:https://github.com/barseghyanartur/tld/

ip库

安装

pip install IPy

使用

from IPy import IP

ipnet = IP('127.0.0.0/30')

ipv4 = IP('1.1.1.1')

ipv6 = IP('1080:0:0:0:8:800:200C:417A')

ip库:https://github.com/autocracy/python-ipy

相关文章

网友评论

      本文标题:python 顶级域库ip库

      本文链接:https://www.haomeiwen.com/subject/uioyzhtx.html