问题标签 [ip2location]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
252 浏览

curl - 如何使用 curl 下载 IP2Location 数据库

我正在尝试使用他们提供的 curl 命令从 IP2Location 下载数据库。我已注册,所以我有一个有效的令牌。他们给出的命令是

这是我正在使用的代码,除了我的令牌:

该脚本运行没有错误,但下载的文件只是他们网站的未找到页面。如果我在浏览器中使用 url,我会找不到相同的页面。有人可以指出我的错误吗?

0 投票
1 回答
99 浏览

python - IP2Location 记录到 Pandas DataFrame

我已经使用 IP2Location 来收集有关 IP 地址的信息,并且我希望它在 DataFrame 中,但是当我尝试使用时pd.json_normalize(ip)出现错误。 AttributeError: 'IP2LocationRecord' object has no attribute 'values'

我从 IP2Location 得到的信息就是这种格式,

{'ip': '66.249.79.244', 'country_short': 'US', 'country_long': 'United States of America', 'region': 'California', 'city': 'Mountain View', 'latitude': 37.405991, 'longitude': -122.078514, 'zipcode': '94043', 'timezone': '-08:00'}

我也尝试过使用pd.DataFrame,但是 df 中的结果是空的,只看到了列名。

df = pd.DataFrame(ip, columns = ['ip','country_short','country_long','region','city','latitude','longitude','zipcode','timezone'])

预期结果

0 投票
0 回答
29 浏览

pandas - 将 IP2LocationRecord 转换为 Pandas.DataFrame

有没有办法使用 IP2Locationdatabase.get_all()并将结果转换为 Pandas DataFrame?我真的很迷茫,不知道该怎么做。

我得到了一个错误AttributeError: 'IP2LocationRecord' object has no attribute 'values'

我得到的值

预期结果

0 投票
1 回答
27 浏览

ip - TOR IP 混淆卢森堡、肯塔基还是亚利桑那?

我用 TOR 尝试了我的网站。

我得到的IP是104.244.73.13

whatismyipaddress.com说这个IP来自美国肯塔基州的黎巴嫩。

它也将其称为“主机名:luxembourg torexit1”。

www.ip2location.com说这个IP来自Mersch Luxembourg的Bissen 。

它也知道它是“代理类型(TOR)Tor出口节点”

它变得更加有趣www.whatismyip.com。它提供了 2 个选项

一个来自IP2Location.com,它是Luxembourg

另一个来自ipdata.co亚利桑那州凤凰城!

老实说,我从未见过 IP 跟踪服务之间存在这样的冲突。

谁给出正确答案?

0 投票
0 回答
50 浏览

python - Python post数据参数在post的请求方法中不起作用

我已经编写了一个代码来从发布请求中抓取页面,但仍然无法正常工作,我认为问题出在发送帖子的数据变量上,我尝试在 http live header 中手动更改请求的值,它可以抓取json 数据,但在 python3 中,还没有。

请帮忙,谢谢!

这是代码:

0 投票
0 回答
33 浏览

download - 我可以下载 IP2location-lite 历史数据库吗?

我想为 caida 2018 IP 数据标记地理信息,所以我想在 2018 年获得 ip2location-lite 免费数据库。但我找不到它,https://lite.ip2location.com/由于该网站需要登录,https://web.archive.org/无法抓取历史数据库。有什么方法可以获取历史数据库吗?提前致谢!