FreeGeoIP给出主机的位置

时间:2015-11-23 06:24:01

标签: azure web location ip

我试图找出基于IP的网络用户的位置,并且我使用StackOverflow帖子中的以下代码

import requests
import json

send_url = 'http://freegeoip.net/json'
r = requests.get(send_url)
j = json.loads(r.text)
lat = j['latitude']
lon = j['longitude']

不幸的是,该网站由Azure托管,而我在freegeoip.net给我一个位于华盛顿州西雅图的位置,可能是在微软总部附近。关于如何解决这个问题的任何想法?

0 个答案:

没有答案