我在我的一端實施谷歌地方服務。當我檢索到json對象時,我意識到json對象(opening_hours)中缺少數組。以下是檢索對象的示例。有誰知道爲什麼某些領域缺失?谷歌地方API缺少開放時間
Hi, i referred to your answers and find a place which has opening hours in google maps but still does not exist in the json object. Below is the example.
[{
"html_attributions": \[
"Listings by <a href=\"http://www.openrice.com/\">OpenRice</a>"
\],
"results": \[
{
"formatted_address": "30 Raffles Ave, Singapore 039803",
"geometry": {
"location": {
"lat": 1.2892988,
"lng": 103.8631368
}
},
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id": "021245e36680793a72b3c428607f0a01ed5d1786",
"name": "Singapore Flyer",
"opening_hours": {
"open_now": true,
"weekday_text": \[\]
},
"photos": \[
{
"height": 2048,
"html_attributions": \[
"<a href=\"https://maps.google.com/maps/contrib/115338279981022433314/photos\">David Montasco</a>"
\],
"photo_reference": "CmRdAAAAWbq-OmrKkZ0Rz9JyDVrnnMjD760XaCdEPBOYLITUhfUCcr6N4YmsMUxyou5yWnMQs4_iQhQc04cR4WOrDuqR5a43ZaH5O5zv4O783lXZP4qDosm-bnUUmyCOV7pNH76LEhBgl4L5ScAvva4b4TkM7-UGGhTmUVujviiDHGICoITSZr5JKJFgQA",
"width": 1367
}
\],
"place_id": "ChIJzVHFNqkZ2jERboLN2YrltH8",
"rating": 4.3,
"reference": "CnRiAAAACBop0imOgmYxPrAp_4b6CIgkGMeaaWb6oL-RsoOK6CxElf7-yNPBz_q5qXVpTfVpsmtWDua6r7gEZdsi9420icrp-mnpG6HLiGmmHupluWkUmuRCdwQ8BRlPW_HYAP9qEblbZMoAbvBDGMZgk_QyoRIQtPeJRN6-_Nm66jH-OMsCBBoUkZDaSDMQqEyPpCOyysU6ulgZtA8",
"types": \[
"establishment"
\]
}
\],
"status": "OK"
}][1]
[文檔](https://developers.google.com/places/web-service/details)表示結果**可能包含以下字段(其中包括opening_hours。你爲什麼期望它在那裏? – geocodezip
您可以添加獲取此數據的請求嗎?我相信只有Google註冊的企業纔會擁有opening_hours數據。即如果我搜索我的房子,它不會有opening_hours,但如果我搜索我附近的銀行,它會。您是否在尋找Google註冊的商家? –
我會驗證你從谷歌抓取並確保它不嵌套在對象內。希望這可以幫助。 – dmoore1987