问题描述
我已使用Python从Google的Places API中提取了json数据。我已经可以提取每个机构的名称和电话号码了。我可以针对API支持的业务类型执行此操作(例如,“ car_repair”。我希望能够提取比“ car_repair”(例如“ auto_body_shop”)更多的特定类型。当我运行以下代码时,它将从API提取指定范围内的前20个结果的名称和电话号码。问题是它们都不是汽车修理厂。
gmaps = googlemaps.Client(key = API_KEY)
places_result = gmaps.places_nearby(location= "40.35003,-111.95206",radius= 4000000,open_Now= False,type= 'car_repair')
pprint.pprint(places_result)
for place in places_result['results']:
my_place_id = place['place_id']
my_fields = ['name','formatted_phone_number','type']
place_details = gmaps.place(place_id = my_place_id,fields = my_fields)
print(place_details['result']['name'],place_details['result']['formatted_phone_number'])
任何想法都有助于扩大我可以从API中提取的业务类型。想到的另一种可能性是,拉动比“ car_repair”更广泛的业务类别,并过滤json数据以仅提取我想要的类型...
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)