希望可以调用高德API接口搜集公交车经纬度数据
报错显示:{'status': '0', 'info': 'INVALID_USER_KEY', 'infocode': '10001'}
import pandas as pd
import json
import requests
import re
key='05fc5de95cf943beb84412f739184b9b'
city='北京'
keywords='2路'
url= 'https://restapi.amap.com/v3/bus/linename?s=rsv3&extensions=all&key={}&output=json&city={}&offset=1&keywords={}&platform=JS'
url.format (key,city, keywords)
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) + \
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0'}
r=requests.get(url,headers=headers).text
rt=json.loads(r)
rt
尝试用Web服务和Web端的key都用不了