怎么查网站后台地址,创新驱动发展战略纲要,wordpress数据表不可用,如何做网站互链规则简介#xff1a;ip2region是一个离线IP地址定位库和IP定位数据管理框架#xff0c;10微秒级别的查询效率#xff0c;提供了众多主流编程语言的 xdb 数据生成和查询客户端实现。号称准确率99.9%的开源离线IP地址定位库。
历史攻略#xff1a;
Python#xff1a;暴力破解密…简介ip2region是一个离线IP地址定位库和IP定位数据管理框架10微秒级别的查询效率提供了众多主流编程语言的 xdb 数据生成和查询客户端实现。号称准确率99.9%的开源离线IP地址定位库。
历史攻略
Python暴力破解密码 - 压缩包、web实战
Python暴力破解密码
真伪之眼探索信息纷争的艺术
Python浏览网页暴露多少信息
GitHub地址
https://github.com/lionsoul2014/ip2region使用步骤
1、下载源码和数据
https://github.com/lionsoul2014/ip2region/archive/refs/heads/master.zip2、本质就是导入和使用data目录下的 ip2region.xdb
官方示例代码iptest.py
# Copyright 2022 The Ip2Region Authors. All rights reserved.
# Use of this source code is governed by a Apache2.0-style
# license that can be found in the LICENSE file.
#from xdbSearcher import XdbSearcherdef searchWithFile():# 1. 创建查询对象dbPath ip2region.xdbsearcher XdbSearcher(dbfiledbPath)# 2. 执行查询ip 1.2.3.4region_str searcher.searchByIPStr(ip)print(region_str)# 3. 关闭searchersearcher.close()def searchWithVectorIndex():# 1. 预先加载整个 xdbdbPath ip2region.xdbvi XdbSearcher.loadVectorIndexFromFile(dbfiledbPath)# 2. 使用上面的缓存创建查询对象, 同时也要加载 xdb 文件searcher XdbSearcher(dbfiledbPath, vectorIndexvi)# 3. 执行查询ip 1.2.3.4region_str searcher.search(ip)print(region_str)# 4. 关闭searchersearcher.close()def searchWithContent():# 1. 预先加载整个 xdbdbPath ip2region.xdbcb XdbSearcher.loadContentFromFile(dbfiledbPath)# 2. 仅需要使用上面的全文件缓存创建查询对象, 不需要传源 xdb 文件searcher XdbSearcher(contentBuffcb)# 3. 执行查询# ip 111.112.113.114ip 101.102.103.104region_str searcher.search(ip)print(region_str)# 4. 关闭searchersearcher.close()if __name__ __main__:searchWithContent()运行结果
中国|0|宁夏|固原市|电信
中国|0|台湾省|台北|0