使用百度api根据ip获取位置
来源:互联网 发布:ecowater 净水器 知乎 编辑:程序博客网 时间:2024/06/01 10:11
在百度http://lbsyun.baidu.com/index.php?title=webapi/high-acc-ip申请key
# -*- coding:utf-8 -*-# author:allen权import sysimport urllib2import json# http://api.map.baidu.com/highacciploc/v1?qcip=ip&qterm=pc&ak=你的key值&extensions=3def get_ip_information(ip): url='http://api.map.baidu.com/highacciploc/v1?qcip='+ip+'&qterm=pc&ak=qterm=pc&ak=key&coord=bd09ll&extensions=3' poiss='' request = urllib2.Request(url) page = urllib2.urlopen(request, timeout=10) data_json = page.read() data_dic = json.loads(data_json) if(data_dic.has_key("content")): content=data_dic["content"] address_component=content["address_component"] formatted_address=content["formatted_address"] print "该IP地址的具体位置为:" print address_component["country"] print formatted_address if (content.has_key("pois")): print "该IP地址附近POI信息如下:" pois = content["pois"] for index in range(len(pois)): pois_name = pois[index]["name"] pois_address = pois[index]["address"] print pois_name, pois_address else: print 'IP地址定位失败!!!'if __name__ == '__main__': get_ip_information('183.55.116.95')
0 0
- 使用百度api根据ip获取位置
- 根据百度地图API,反向获取某个位置的经纬度
- 根据远程ip获取位置
- python 使用geoLiteCity 根据ip地址获取物理位置
- 百度api获取用户位置
- [Python] 根据IP获取位置信息
- java根据ip地质调用百度定位api服务获取地理位置示例
- java根据ip地质调用百度定位api服务获取地理位置示例
- 利用百度api技术获取客户端IP地址经纬度及所在城市位置
- 百度地图根据位置获取对应的位置中文
- 百度api根据经纬度获取地址
- .net根据经纬度获取地址(百度api)
- 百度地图API根据具体地址获取经纬度
- java根据地址获取百度API经纬度
- 百度地图api--根据经纬度获取地点
- 百度API-根据地址获取经纬度
- 百度api获取经纬度及详细位置
- IP获取城市位置信息 API
- Oracle的导入和导出
- java 修饰词 private final 简单的理解
- MySQL常用性能分析方法-profile,explain,索引
- 组合数学之稳定婚姻问题
- Nginx+Tomcat搭建高性能负载均衡集群
- 使用百度api根据ip获取位置
- Run matlab in server background
- IDA调试so文件进阶篇
- leetcode No148. Sort List
- hibernate保存报错:a different object with the same identifier value was already associated with the ses
- 有他们在密码更安全
- What's new in Xcode 8
- 聪明的投资者 摘录
- Caffe的卷积原理