我正在通过输入酒店名称进行酒店搜索.Below是有效的JSON响应。这是一家酒店搜索的回应。我已经运行了15个线程,并且针对与此类似的不同酒店,我还有14个JSON响应。在这个回应中,您可以看到提供者使用数组值的“提供者”和“结果”。我的要求是找出有多少优惠,即每家提供商共有15家酒店。从JSON响应中提取和处理
"providers":
[
{
"MM_logofile":"agd.svg",
"MM_isOfficialWithoutLogo":false,
"code":"AGD",
"name":"Agoda.com",
"logo":"AGD.png",
"isOfficial":false
},
{
"MM_logofile":"ian.svg",
"MM_isOfficialWithoutLogo":false,
"code":"IAN",
"name":"Hotels.com",
"logo":"IAN-Other.png",
"isOfficial":false
},
{
"MM_logofile":"gar.svg",
"MM_isOfficialWithoutLogo":false,
"code":"GAR",
"name":"getaroom.com",
"logo":"GAR.png",
"isOfficial":false
},
{
"MM_logofile":"exp.svg",
"MM_isOfficialWithoutLogo":false,
"code":"EXP",
"name":"Expedia.dk",
"logo":"EXP-DK.png",
"isOfficial":false
},
{
"MM_logofile":"acc.svg",
"MM_isOfficialWithoutLogo":false,
"code":"ACC",
"name":"AccorHotels.com",
"logo":"ACC.png",
"isOfficial":true
},
],
"results":
[
{
"roomName":"Standard Twin Rm Special Offer - Best price guarantee",
"totalRate":918.0,
"isCheapestRate":true,
"hasFreeCancelation":false,
"inclusions":
[
],
"availableRooms":null,
"providerIndex":0,
"includesAllTaxes":false,
"excludedCharges":
[
0
],
"bookUri":"https://72750.api.hotelscombined.com/ProviderRedirect.ashx?key=0.11648360.-378376995.495.USD.123155627&source=202-0&a_aid=72750&brandID=177977"
},
{
"roomName":"Standard Double Rm Special Offer - Best price guarantee",
"totalRate":918.0,
"isCheapestRate":false,
"hasFreeCancelation":false,
"inclusions":
[
],
"availableRooms":null,
"providerIndex":0,
"includesAllTaxes":false,
"excludedCharges":
[
0
],
"bookUri":"https://72750.api.hotelscombined.com/ProviderRedirect.ashx?key=0.11648360.-378376995.496.USD.1523114518&source=202-1&a_aid=72750&brandID=177977"
},
{
"roomName":"Standard Double Room Hot Deal - Best price guarantee",
"totalRate":918.0,
"isCheapestRate":false,
"hasFreeCancelation":false,
"inclusions":
[
],
"availableRooms":null,
"providerIndex":1,
"includesAllTaxes":false,
"excludedCharges":
[
0
],
"bookUri":"https://72750.api.hotelscombined.com/ProviderRedirect.ashx?key=0.11648360.-378376995.497.USD.573302441&source=202-2&a_aid=72750&brandID=177977"
},
{
"roomName":"Standard Twin Room Hot Deal - Best price guarantee",
"totalRate":918.0,
"isCheapestRate":false,
"hasFreeCancelation":false,
"inclusions":
[
],
"availableRooms":null,
"providerIndex":2,
"includesAllTaxes":false,
"excludedCharges":
[
0
],
"bookUri":"https://72750.api.hotelscombined.com/ProviderRedirect.ashx?key=0.11648360.-378376995.498.USD.1523907592&source=202-3&a_aid=72750&brandID=177977"
},
{
"roomName":"Standard Room, 1 Double Bed",
"totalRate":926.2,
"isCheapestRate":false,
"hasFreeCancelation":false,
"inclusions":
[
],
"availableRooms":null,
"providerIndex":3,
"includesAllTaxes":false,
"excludedCharges":
[
0
],
"bookUri":"https://72750.api.hotelscombined.com/ProviderRedirect.ashx?key=0.13476094.-378377052.1210.USD.1325439035&source=202-4&a_aid=72750&brandID=177977"
},
],
代码在哪里? json在哪里? – Weedoze
尝试添加部分json,并将建立在 –
我正在做它。我的回复太长,所以无法发布。给我一分钟。 – Jane