import requests
from lxml import etree
from tld import get_fld
url = 'https://sp1.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query={}&resource_id=5809&format=json'
record_url = 'https://icp.chinaz.com/{}'
proxies = {"http": None, "https": None}
class GetHost:
# 域名
domain = ''
# IP地址
ip = ''
# IP归属地
location = ''
# 主办单位名称
org_name = ''
# 主办单位性质
sponsor_nature = ''
# 网站名称
website_name = ''
def __init__(self, domain, ip):
self.domain = domain
self.ip = ip
self.get_host_info()
def get_host_info(self):
if self.ip == '':
self.ip