实际地址经纬度提取
请求接口:
https://apis.map.qq.com/ws/place/v1/suggestion/
所需参数:
'''
遇到问题没人解答?小编创建了一个Python学习交流QQ群:778463939
寻找有志同道合的小伙伴,互帮互助,群里还有不错的视频学习教程和PDF电子书!
'''
url = "https://apis.map.qq.com/ws/place/v1/suggestion/"
headers= {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
"Referer": "https://lbs.qq.com/tool/getpoint/getpoint.html"
}
param = {
"keyword":"双井地铁站",
"region": "",
"key":"K76BZ-W3O2Q-RFL5S-GXOPR-3ARIT-6KFE5",
"output":"jsonp",
"callback":"jQuery191023148659560008777_1554977748452",
"_":"1554977748452"
}
response = requests.get(url,params=param,headers=headers)
print(response.text)
返回结果
jQuery191023148659560008777_1554977748452&&jQuery191023148659560008777_1554977748452({
"status": 0,
"message": "query ok",
"count": 10,
"data": [
{
"id": "10003971829677132621",
"title": "双井[地铁站]",
"address": "地铁10号线",
"category": "基础设施:交通设施:地铁站",
"type": 2,
"location": {
"lat": 39.89351,
"lng": 116.461802
},
"adcode": 110105,
"province": "北京市",
"city": "北京市",
"district": "朝阳区"
}
],
"request_id": "12750947604550948"
})