import googlemaps
import pprint
import time
key= input('key:')
gmaps = googlemaps.Client(key=key)
#location:搜尋位置的經緯度,radius:搜尋的半徑以米為單位open_now:是否獲取地點詳情,查找的例如convenience_store(便利商店)
#type英文對應關係的網頁:
#查詢地點的經緯度請看這
places_result = gmaps.places_nearby(location='25.114842, 121.516219',radius=1000,open_now=False,type='convenience_store')
#pprint.pprint:將返回的對象格式化
pprint.pprint(places_result)
#當你想要獲取下一組訊息時必須給google一些加載訊息的時間,不然有時候會加載失敗
time.sleep(3)
#當你發出請求後並且獲取訊息,會得到一個next_page_token的令牌,使用這一組令牌來訪問下一組訊息
#請求下一組數據最多返回20條訊息
pr