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))

输出结果:

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

谢谢!

05-11 19:28