JSON "End of file expected" hatası

uguratakan

Megapat
Katılım
4 Temmuz 2016
Mesajlar
742
Çözümler
4
Yer
visor01 @ istikram.
Daha fazla  
Cinsiyet
Erkek
Meslek
Mobil Uygulama Geliştirici
Elimde bir json dosyası var ben bunu SQL'e çevireceğim fakat şöyle bir sorunla karşılaşıyorum. "end of file expected" hata olarak gösterdiği işaret her zaman 2. verinin başlangıcında duran "{" işareti.
Belki VS Code yanlış okuyordur diyerek denemediğimde ise aşağıdaki hatayı veriyor. Python scriptini ve hatasının ekran görüntüsünü ekliyorum aşağıya.
Kodun kendisi ise şu:

[CODE lang="json" title="Hata veren kod"]
{
"address": "Silvrettastrasse 120, See",
"amenity_groups": [
{
"amenities": [
"Heating",
"All Spaces Non-Smoking (public and private)",
"Radio"
],
"group_name": "General"
},
{
"amenities": [
"Cable TV",
"Wardrobe/Closet"
],
"group_name": "Rooms"
},
{
"amenities": [
"Kitchen",
"Coffeemaker"
],
"group_name": "Meals"
},
{
"amenities": [
"Wi-Fi",
"In-room internet"
],
"group_name": "Internet"
},
{
"amenities": [
"Hiking"
],
"group_name": "Recreation"
},
{
"amenities": [
"Ski storage",
"Skiing"
],
"group_name": "Winter sports"
}
],
"check_in_time": "12:00:00",
"check_out_time": "10:30:00",
"description_struct": [
{
"paragraphs": [
"Located 1.1 km from 6 EUB Medrijoch in See, this apartment features free WiFi. Guests benefit from patio and a terrace. Free private parking is available on site.",
"A fridge and a stovetop can be found in the kitchen. A flat-screen TV is featured. There is a private bathroom with a bath or shower.",
"6 KSB Zeinisbahn is 2 km from Haus Matt, while Raukopflift is 2 km from the property. The area is popular for skiing and hiking. Innsbruck Airport is 71 km away."
],
"title": null
}
],
"id": "haus_matt",
"images": [],
"kind": "Cottages_and_Houses",
"latitude": 47.07732009887695,
"longitude": 10.450867652893066,
"name": "Haus Matt",
"phone": "+436767101611",
"policy_struct": [
{
"paragraphs": [
"Information about the type of meals included in the price is indicated in the rate details."
],
"title": "Meals"
},
{
"paragraphs": [
"Due to the epidemiological situation, tourist trips are limited throughout Austria.",
"The hotel does not accept children under 18 years of age staying alone."
],
"title": "Extra info"
}
],
"postal_code": "6553",
"room_groups": [],
"region": {
"id": 6046178,
"country_code": "AT",
"iata": null,
"name": "See",
"type": "City"
},
"star_rating": 1,
"email": null,
"semantic_version": 0,
"serp_filters": [
"has_internet",
"kitchen"
],
"is_closed": false,
"metapolicy_struct": {
"internet": [],
"meal": [],
"children_meal": [],
"extra_bed": [],
"cot": [],
"pets": [],
"shuttle": [],
"parking": [],
"children": [],
"visa": {
"visa_support": "unspecified"
},
"deposit": [],
"no_show": {
"availability": "unspecified",
"time": null,
"day_period": "unspecified"
},
"add_fee": [],
"check_in_check_out": []
},
"metapolicy_extra_info": "Due to the epidemiological situation, tourist trips are limited throughout Austria.\nThe hotel does not accept children under 18 years of age staying alone.",
"star_certificate": null,
"facts": {
"floors_number": null,
"rooms_number": 1,
"year_built": null,
"year_renovated": null,
"electricity": {
"frequency": [
50
],
"voltage": [
230
],
"sockets": [
"c",
"f"
]
}
},
"payment_methods": [],
"hotel_chain": null
}
{
"address": "Ulitsa Metallurgov 7, Cherepovets",
"amenity_groups": [
{
"amenities": [
"Kettle"
],
"group_name": "Meals"
}
],
"check_in_time": "14:00:00",
"check_out_time": "12:00:00",
"description_struct": [
{
"paragraphs": [
"A great option for family vacation: apartment �Lux35 Apartment Metallurgov 7� is located in Cherepovets. This apartment is located in the city center. In the morning, have a cup of coffee while looking at the city from the window. You can take a walk and explore the neighbourhood area of the apartment. Places nearby: Sheksna Lomonosov Beach."
],
"title": "Location"
}
],
"id": "lux35_apartment_metallurgov_7",
"images": [
"https://cdn.ostrovok.ru/t/{size}/content/04/c8/04c80b1a93fa9ee4ef3223a2c0cd569b6ae9b944.jpeg",
"https://cdn.ostrovok.ru/t/{size}/content/8d/36/8d3661470c9b7e8637a4763b959367823c3145c7.jpeg",
"https://cdn.ostrovok.ru/t/{size}/content/18/52/18526fee4129f73f2e76b48ad74bdbfed1ee2eff.jpeg"
],
"kind": "Apartment",
"latitude": 59.12995529174805,
"longitude": 37.90951156616211,
"name": "Lux35 Apartment Metallurgov 7",
"phone": "8 800 65 987",
"policy_struct": [
{
"paragraphs": [
"Information about the type of meals included in the price is indicated in the rate details."
],
"title": "Meals"
},
{
"paragraphs": [
"Russian citizens must have an original Russian passport upon arrival.",
"The hotel does not accept children under 18 years of age staying alone."
],
"title": "Extra info"
}
],
"postal_code": "162600",
"room_groups": [
{
"room_group_id": 226,
"images": [],
"name": "Double Apartment full double bed",
"room_amenities": [],
"rg_ext": {
"class": 6,
"quality": 0,
"sex": 0,
"bathroom": 2,
"bedding": 3,
"family": 0,
"capacity": 2,
"club": 0
},
"name_struct": {
"bathroom": null,
"bedding_type": "full double bed",
"main_name": "Double Apartment"
}
}
],
"region": {
"id": 6589,
"country_code": "RU",
"iata": "CEE",
"name": "Cherepovets",
"type": "City"
},
"star_rating": 0,
"email": null,
"semantic_version": 0,
"serp_filters": [
"beach"
],
"is_closed": false,
"metapolicy_struct": {
"internet": [],
"meal": [],
"children_meal": [],
"extra_bed": [],
"cot": [],
"pets": [],
"shuttle": [],
"parking": [],
"children": [],
"visa": {
"visa_support": "unspecified"
},
"deposit": [],
"no_show": {
"availability": "unspecified",
"time": null,
"day_period": "unspecified"
},
"add_fee": [],
"check_in_check_out": []
},
"metapolicy_extra_info": "Russian citizens must have an original Russian passport upon arrival.\nThe hotel does not accept children under 18 years of age staying alone.",
"star_certificate": null,
"facts": {
"floors_number": null,
"rooms_number": null,
"year_built": null,
"year_renovated": null,
"electricity": {
"frequency": [
50
],
"voltage": [
230
],
"sockets": [
"c",
"f"
]
}
},
"payment_methods": [],
"hotel_chain": null
}
[/CODE]
 

Dosya Ekleri

  • jsonhatası.JPG
    jsonhatası.JPG
    45,7 KB · Görüntüleme: 153
  • python hatası.JPG
    python hatası.JPG
    85 KB · Görüntüleme: 108
Kod:
{
  "houses": [
    {
      "address": "Silvrettastrasse 120, See",
      "amenity_groups": [
        {
          "amenities": [
            "Heating",
            "All Spaces Non-Smoking (public and private)",
            "Radio"
          ],
          "group_name": "General"
        },
        {
          "amenities": [
            "Cable TV",
            "Wardrobe/Closet"
          ],
          "group_name": "Rooms"
        },
        {
          "amenities": [
            "Kitchen",
            "Coffeemaker"
          ],
          "group_name": "Meals"
        },
        {
          "amenities": [
            "Wi-Fi",
            "In-room internet"
          ],
          "group_name": "Internet"
        },
        {
          "amenities": [
            "Hiking"
          ],
          "group_name": "Recreation"
        },
        {
          "amenities": [
            "Ski storage",
            "Skiing"
          ],
          "group_name": "Winter sports"
        }
      ],
      "check_in_time": "12:00:00",
      "check_out_time": "10:30:00",
      "description_struct": [
        {
          "paragraphs": [
            "Located 1.1 km from 6 EUB Medrijoch in See, this apartment features free WiFi. Guests benefit from patio and a terrace. Free private parking is available on site.",
            "A fridge and a stovetop can be found in the kitchen. A flat-screen TV is featured. There is a private bathroom with a bath or shower.",
            "6 KSB Zeinisbahn is 2 km from Haus Matt, while Raukopflift is 2 km from the property. The area is popular for skiing and hiking. Innsbruck Airport is 71 km away."
          ],
          "title": null
        }
      ],
      "id": "haus_matt",
      "images": [],
      "kind": "Cottages_and_Houses",
      "latitude": 47.07732009887695,
      "longitude": 10.450867652893066,
      "name": "Haus Matt",
      "phone": "+436767101611",
      "policy_struct": [
        {
          "paragraphs": [
            "Information about the type of meals included in the price is indicated in the rate details."
          ],
          "title": "Meals"
        },
        {
          "paragraphs": [
            "Due to the epidemiological situation, tourist trips are limited throughout Austria.",
            "The hotel does not accept children under 18 years of age staying alone."
          ],
          "title": "Extra info"
        }
      ],
      "postal_code": "6553",
      "room_groups": [],
      "region": {
        "id": 6046178,
        "country_code": "AT",
        "iata": null,
        "name": "See",
        "type": "City"
      },
      "star_rating": 1,
      "email": null,
      "semantic_version": 0,
      "serp_filters": [
        "has_internet",
        "kitchen"
      ],
      "is_closed": false,
      "metapolicy_struct": {
        "internet": [],
        "meal": [],
        "children_meal": [],
        "extra_bed": [],
        "cot": [],
        "pets": [],
        "shuttle": [],
        "parking": [],
        "children": [],
        "visa": {
          "visa_support": "unspecified"
        },
        "deposit": [],
        "no_show": {
          "availability": "unspecified",
          "time": null,
          "day_period": "unspecified"
        },
        "add_fee": [],
        "check_in_check_out": []
      },
      "metapolicy_extra_info": "Due to the epidemiological situation, tourist trips are limited throughout Austria.\nThe hotel does not accept children under 18 years of age staying alone.",
      "star_certificate": null,
      "facts": {
        "floors_number": null,
        "rooms_number": 1,
        "year_built": null,
        "year_renovated": null,
        "electricity": {
          "frequency": [
            50
          ],
          "voltage": [
            230
          ],
          "sockets": [
            "c",
            "f"
          ]
        }
      },
      "payment_methods": [],
      "hotel_chain": null
    },
    {
      "address": "Ulitsa Metallurgov 7, Cherepovets",
      "amenity_groups": [
        {
          "amenities": [
            "Kettle"
          ],
          "group_name": "Meals"
        }
      ],
      "check_in_time": "14:00:00",
      "check_out_time": "12:00:00",
      "description_struct": [
        {
          "paragraphs": [
            "A great option for family vacation: apartment �Lux35 Apartment Metallurgov 7� is located in Cherepovets. This apartment is located in the city center. In the morning, have a cup of coffee while looking at the city from the window. You can take a walk and explore the neighbourhood area of the apartment. Places nearby: Sheksna Lomonosov Beach."
          ],
          "title": "Location"
        }
      ],
      "id": "lux35_apartment_metallurgov_7",
      "images": [
        "https://cdn.ostrovok.ru/t/{size}/content/04/c8/04c80b1a93fa9ee4ef3223a2c0cd569b6ae9b944.jpeg",
        "https://cdn.ostrovok.ru/t/{size}/content/8d/36/8d3661470c9b7e8637a4763b959367823c3145c7.jpeg",
        "https://cdn.ostrovok.ru/t/{size}/content/18/52/18526fee4129f73f2e76b48ad74bdbfed1ee2eff.jpeg"
      ],
      "kind": "Apartment",
      "latitude": 59.12995529174805,
      "longitude": 37.90951156616211,
      "name": "Lux35 Apartment Metallurgov 7",
      "phone": "8 800 65 987",
      "policy_struct": [
        {
          "paragraphs": [
            "Information about the type of meals included in the price is indicated in the rate details."
          ],
          "title": "Meals"
        },
        {
          "paragraphs": [
            "Russian citizens must have an original Russian passport upon arrival.",
            "The hotel does not accept children under 18 years of age staying alone."
          ],
          "title": "Extra info"
        }
      ],
      "postal_code": "162600",
      "room_groups": [
        {
          "room_group_id": 226,
          "images": [],
          "name": "Double Apartment full double bed",
          "room_amenities": [],
          "rg_ext": {
            "class": 6,
            "quality": 0,
            "sex": 0,
            "bathroom": 2,
            "bedding": 3,
            "family": 0,
            "capacity": 2,
            "club": 0
          },
          "name_struct": {
            "bathroom": null,
            "bedding_type": "full double bed",
            "main_name": "Double Apartment"
          }
        }
      ],
      "region": {
        "id": 6589,
        "country_code": "RU",
        "iata": "CEE",
        "name": "Cherepovets",
        "type": "City"
      },
      "star_rating": 0,
      "email": null,
      "semantic_version": 0,
      "serp_filters": [
        "beach"
      ],
      "is_closed": false,
      "metapolicy_struct": {
        "internet": [],
        "meal": [],
        "children_meal": [],
        "extra_bed": [],
        "cot": [],
        "pets": [],
        "shuttle": [],
        "parking": [],
        "children": [],
        "visa": {
          "visa_support": "unspecified"
        },
        "deposit": [],
        "no_show": {
          "availability": "unspecified",
          "time": null,
          "day_period": "unspecified"
        },
        "add_fee": [],
        "check_in_check_out": []
      },
      "metapolicy_extra_info": "Russian citizens must have an original Russian passport upon arrival.\nThe hotel does not accept children under 18 years of age staying alone.",
      "star_certificate": null,
      "facts": {
        "floors_number": null,
        "rooms_number": null,
        "year_built": null,
        "year_renovated": null,
        "electricity": {
          "frequency": [
            50
          ],
          "voltage": [
            230
          ],
          "sockets": [
            "c",
            "f"
          ]
        }
      },
      "payment_methods": [],
      "hotel_chain": null
    }
  ]
}
ya da
Kod:
[
  {
    "address": "Silvrettastrasse 120, See",
    "amenity_groups": [
      {
        "amenities": [
          "Heating",
          "All Spaces Non-Smoking (public and private)",
          "Radio"
        ],
        "group_name": "General"
      },
      {
        "amenities": [
          "Cable TV",
          "Wardrobe/Closet"
        ],
        "group_name": "Rooms"
      },
      {
        "amenities": [
          "Kitchen",
          "Coffeemaker"
        ],
        "group_name": "Meals"
      },
      {
        "amenities": [
          "Wi-Fi",
          "In-room internet"
        ],
        "group_name": "Internet"
      },
      {
        "amenities": [
          "Hiking"
        ],
        "group_name": "Recreation"
      },
      {
        "amenities": [
          "Ski storage",
          "Skiing"
        ],
        "group_name": "Winter sports"
      }
    ],
    "check_in_time": "12:00:00",
    "check_out_time": "10:30:00",
    "description_struct": [
      {
        "paragraphs": [
          "Located 1.1 km from 6 EUB Medrijoch in See, this apartment features free WiFi. Guests benefit from patio and a terrace. Free private parking is available on site.",
          "A fridge and a stovetop can be found in the kitchen. A flat-screen TV is featured. There is a private bathroom with a bath or shower.",
          "6 KSB Zeinisbahn is 2 km from Haus Matt, while Raukopflift is 2 km from the property. The area is popular for skiing and hiking. Innsbruck Airport is 71 km away."
        ],
        "title": null
      }
    ],
    "id": "haus_matt",
    "images": [],
    "kind": "Cottages_and_Houses",
    "latitude": 47.07732009887695,
    "longitude": 10.450867652893066,
    "name": "Haus Matt",
    "phone": "+436767101611",
    "policy_struct": [
      {
        "paragraphs": [
          "Information about the type of meals included in the price is indicated in the rate details."
        ],
        "title": "Meals"
      },
      {
        "paragraphs": [
          "Due to the epidemiological situation, tourist trips are limited throughout Austria.",
          "The hotel does not accept children under 18 years of age staying alone."
        ],
        "title": "Extra info"
      }
    ],
    "postal_code": "6553",
    "room_groups": [],
    "region": {
      "id": 6046178,
      "country_code": "AT",
      "iata": null,
      "name": "See",
      "type": "City"
    },
    "star_rating": 1,
    "email": null,
    "semantic_version": 0,
    "serp_filters": [
      "has_internet",
      "kitchen"
    ],
    "is_closed": false,
    "metapolicy_struct": {
      "internet": [],
      "meal": [],
      "children_meal": [],
      "extra_bed": [],
      "cot": [],
      "pets": [],
      "shuttle": [],
      "parking": [],
      "children": [],
      "visa": {
        "visa_support": "unspecified"
      },
      "deposit": [],
      "no_show": {
        "availability": "unspecified",
        "time": null,
        "day_period": "unspecified"
      },
      "add_fee": [],
      "check_in_check_out": []
    },
    "metapolicy_extra_info": "Due to the epidemiological situation, tourist trips are limited throughout Austria.\nThe hotel does not accept children under 18 years of age staying alone.",
    "star_certificate": null,
    "facts": {
      "floors_number": null,
      "rooms_number": 1,
      "year_built": null,
      "year_renovated": null,
      "electricity": {
        "frequency": [
          50
        ],
        "voltage": [
          230
        ],
        "sockets": [
          "c",
          "f"
        ]
      }
    },
    "payment_methods": [],
    "hotel_chain": null
  },
  {
    "address": "Ulitsa Metallurgov 7, Cherepovets",
    "amenity_groups": [
      {
        "amenities": [
          "Kettle"
        ],
        "group_name": "Meals"
      }
    ],
    "check_in_time": "14:00:00",
    "check_out_time": "12:00:00",
    "description_struct": [
      {
        "paragraphs": [
          "A great option for family vacation: apartment �Lux35 Apartment Metallurgov 7� is located in Cherepovets. This apartment is located in the city center. In the morning, have a cup of coffee while looking at the city from the window. You can take a walk and explore the neighbourhood area of the apartment. Places nearby: Sheksna Lomonosov Beach."
        ],
        "title": "Location"
      }
    ],
    "id": "lux35_apartment_metallurgov_7",
    "images": [
      "https://cdn.ostrovok.ru/t/{size}/content/04/c8/04c80b1a93fa9ee4ef3223a2c0cd569b6ae9b944.jpeg",
      "https://cdn.ostrovok.ru/t/{size}/content/8d/36/8d3661470c9b7e8637a4763b959367823c3145c7.jpeg",
      "https://cdn.ostrovok.ru/t/{size}/content/18/52/18526fee4129f73f2e76b48ad74bdbfed1ee2eff.jpeg"
    ],
    "kind": "Apartment",
    "latitude": 59.12995529174805,
    "longitude": 37.90951156616211,
    "name": "Lux35 Apartment Metallurgov 7",
    "phone": "8 800 65 987",
    "policy_struct": [
      {
        "paragraphs": [
          "Information about the type of meals included in the price is indicated in the rate details."
        ],
        "title": "Meals"
      },
      {
        "paragraphs": [
          "Russian citizens must have an original Russian passport upon arrival.",
          "The hotel does not accept children under 18 years of age staying alone."
        ],
        "title": "Extra info"
      }
    ],
    "postal_code": "162600",
    "room_groups": [
      {
        "room_group_id": 226,
        "images": [],
        "name": "Double Apartment full double bed",
        "room_amenities": [],
        "rg_ext": {
          "class": 6,
          "quality": 0,
          "sex": 0,
          "bathroom": 2,
          "bedding": 3,
          "family": 0,
          "capacity": 2,
          "club": 0
        },
        "name_struct": {
          "bathroom": null,
          "bedding_type": "full double bed",
          "main_name": "Double Apartment"
        }
      }
    ],
    "region": {
      "id": 6589,
      "country_code": "RU",
      "iata": "CEE",
      "name": "Cherepovets",
      "type": "City"
    },
    "star_rating": 0,
    "email": null,
    "semantic_version": 0,
    "serp_filters": [
      "beach"
    ],
    "is_closed": false,
    "metapolicy_struct": {
      "internet": [],
      "meal": [],
      "children_meal": [],
      "extra_bed": [],
      "cot": [],
      "pets": [],
      "shuttle": [],
      "parking": [],
      "children": [],
      "visa": {
        "visa_support": "unspecified"
      },
      "deposit": [],
      "no_show": {
        "availability": "unspecified",
        "time": null,
        "day_period": "unspecified"
      },
      "add_fee": [],
      "check_in_check_out": []
    },
    "metapolicy_extra_info": "Russian citizens must have an original Russian passport upon arrival.\nThe hotel does not accept children under 18 years of age staying alone.",
    "star_certificate": null,
    "facts": {
      "floors_number": null,
      "rooms_number": null,
      "year_built": null,
      "year_renovated": null,
      "electricity": {
        "frequency": [
          50
        ],
        "voltage": [
          230
        ],
        "sockets": [
          "c",
          "f"
        ]
      }
    },
    "payment_methods": [],
    "hotel_chain": null
  }
]
İki JSON'u böyle ardarda yazamazınız. Şuna benzer bi düzenleme şart.
 
Son düzenleme:
1.satırın başına [ 142.satirin sonuna , 271.satirin sonuna ] koymayi deneyin. Böylece 2 sözlük verisi içeren 1 listeniz olur.
 
1.satırın başına [ 142.satirin sonuna , 271.satirin sonuna ] koymayi deneyin. Böylece 2 sözlük verisi içeren 1 listeniz olur.
Bu dediğiniz şekilde denediğimde yine hata veriyordu 142'nin sonuna , koydum hata vermedi ama veri düzgün çekildi mi onu kontrol ediyorum şuan.
@Luthienn , @qusH
İkinizin dediğinde de aynı şekilde bir tablo çıkıyor. Normali bu mudur yoksa ben mi yanlış biliyorum.
Ben burada 2 tane otel olduğu için 2 otele ait 2 satır veri oluşacak diye bekliyordum.
1626616642616.png
 
Son düzenleme:
Uyarı! Bu konu 5 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Technopat Haberler

Geri
Yukarı