获取顶级域名与一级域名的python库-tld
生活随笔
收集整理的這篇文章主要介紹了
获取顶级域名与一级域名的python库-tld
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
可以參考:https://pypi.org/project/tld/
獲得頂級(jí)域名與一級(jí)域名的python庫。get_tld與get_fld?
from tld import get_tld url = 'https://www.honchosearch.com/blog/seo/' #URL to strip. Change this URL to whatever you want. res = get_tld(url, as_object=True) #Get the root as an object print (res.fld) #res.fld to extract the domain 返回對(duì)象,然后獲取想要的一級(jí)域名?
與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的获取顶级域名与一级域名的python库-tld的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 字符串中斜杠换行注意事项之-多余空格
- 下一篇: 创建python2与python3虚拟环