Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure 提供主机位置的FreeGeoIP_Azure_Web_Location_Ip - Fatal编程技术网

Azure 提供主机位置的FreeGeoIP

Azure 提供主机位置的FreeGeoIP,azure,web,location,ip,Azure,Web,Location,Ip,我正试图根据IP找出一个web用户的位置,我正在使用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,它给了我一个

我正试图根据IP找出一个web用户的位置,我正在使用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,它给了我一个位于华盛顿州西雅图的位置,大概在微软总部附近。关于如何解决这个问题有什么想法吗?

嗨,这里是freegeoip.net的作者。您正在使用的URL用于获取您自己的IP。如果您想获得另一台服务器的IP,请改用.Hi,这里是freegoip.net的作者。您正在使用的URL用于获取您自己的IP。如果要获取另一台服务器的IP,请改用。