根据IP查地理位置信息

时间:2023-12-25 11:44:07

IP地址库下载地址:

https://www.ipip.net/product/ip.html

使用方式(Python):

https://github.com/ipipdotnet/datx-python

import datx

c = datx.City("ipdata_new.datx")
ip = '183.156.1.109' print(c.find(ip))

输出结果:

['中国', '浙江', '杭州', '']

谢谢!