结果是获取最新的纯净IP,仅包含地区和运营商
#! Python/ target=_blank class=infotextkey>Python
# _*_ coding=UTF-8 _*_
"""
获取最新纯真IP,仅包含地区和运营商
"""
import requests
with open('.NET_ip.txt', encoding='UTF-8') as a:
for i in a:
url = f'
https://ipaddr.vercel.App/api/{i}' # 遍历net_ip.txt文本里的所有公网IP地址r = requests.get(url).json()
dict_ip = r["detail"]
print('查询IP:', r["search_ip"])
print('地区:', r["addr"])
print('运营商:', r["detail"])
print('n')
打印结果:
运行结果