json.decoder.JSONDecodeError:额外数据:第2行第1列(字符5357)

时间:2018-10-09 02:16:20

标签: python json parsing

我收到此错误

  

(json.decoder.JSONDecodeError:额外数据:第2行第1列(char   5357))

解析json文件时。是什么原因呢?请让我知道如何解析json文件中的值?

这是我的文件:

     {"auctionId":"06sLuJ8oov","bidRequestString":"{\"id\":\"06sLuJ8oov\",\"timestamp\":\"2017-01-11T00:00:00.197Z\",\"isTest\":false,\"url\":\"http://com.hornet.android/\",\"ipAddress\":\"115.164.181.161\",\"userAgent\":\"Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; HM NOTE 1W Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30\",\"exchange\":\"smaato\",\"provider\":\"smaato\",\"location\":{\"countryCode\":\"MYS\",\"regionCode\":\"07\",\"cityName\":\"Sitiawan\",\"postalCode\":\"32000\",\"dma\":-1,\"metro\":0,\"timezoneOffsetMinutes\":-1},\"segments\":{\"api-banner\":[\"MRAID-1\",\"MRAID-2\"],\"app-bundle\":[\"com.hornet.android\"],\"device-carrier\":[\"502-16\"],\"device-connection\":[5],\"device-make\":[\"Xiaomi\"],\"device-model\":[\"HM NOTE 1W\"],\"device-os\":[\"Android\"],\"device-os-version\":[\"4.2\"],\"device-type\":[1],\"iab-categories\":[\"IAB14\",\"IAB14-3\"],\"openrtb-wseat\":[]},\"restrictions\":{\"badv\":[\"https://itunes.apple.com/de/app/blued-gay-social-live-broadcasting/id1090274263?mt=8\",\"https://itunes.apple.com/de/app/radar.tv/id1119912404?mt=8\",\"https://play.google.com/store/apps/details?id=com.blued.international\"],\"bcat\":[\"IAB11\",\"IAB14-1\",\"IAB17-18\",\"IAB22-1\",\"IAB23\",\"IAB24\",\"IAB25\",\"IAB26\",\"IAB3-7\",\"IAB7-28\",\"IAB7-42\",\"IAB8-18\",\"IAB8-5\",\"IAB9-7\",\"IAB9-9\"]},\"userIds\":{\"prov\":\"16371335939681845049\"},\"imp\":[{\"id\":\"1\",\"banner\":{\"w\":320,\"h\":50,\"pos\":0,\"btype\":[1],\"battr\":[1,3,5,8,9],\"mimes\":[\"text/javascript\",\"application/javascript\",\"image/jpeg\",\"image/png\",\"image/gif\"],\"topframe\":0,\"api\":[3,5]},\"displaymanager\":\"SOMA\",\"displaymanagerver\":\"sdkandroid_5-0-6\",\"tagid\":\"130119680\",\"secure\":0,\"ext\":{\"strictbannersize\":0},\"formats\":[\"320x50\"],\"position\":0}],\"spots\":[{\"id\":\"1\",\"banner\":{\"w\":320,\"h\":50,\"pos\":0,\"btype\":[1],\"battr\":[1,3,5,8,9],\"mimes\":[\"text/javascript\",\"application/javascript\",\"image/jpeg\",\"image/png\",\"image/gif\"],\"topframe\":0,\"api\":[3,5]},\"displaymanager\":\"SOMA\",\"displaymanagerver\":\"sdkandroid_5-0-6\",\"tagid\":\"130119680\",\"secure\":0,\"ext\":{\"strictbannersize\":0},\"formats\":[\"320x50\"],\"position\":0}],\"app\":{\"id\":\"130119680\",\"name\":\"HornetNetworks_Hornet_Android_HornetNetworks_Hornet_Android_phone_banner_P_Android_XXLARGE_320x50_IAB14-3,IAB14\",\"domain\":\"play.google.com\",\"cat\":[\"IAB14-3\",\"IAB14\"],\"publisher\":{\"id\":\"1100006659\",\"name\":\"AddApptr GmbH\"},\"bundle\":\"com.hornet.android\"},\"device\":{\"ua\":\"Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; HM NOTE 1W Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30\",\"ip\":\"115.164.181.161\",\"geo\":{\"lat\":4.20981,\"lon\":100.68144,\"country\":\"MYS\",\"region\":\"07\",\"metro\":\"0\",\"city\":\"Sitiawan\",\"zip\":\"32000\",\"type\":1},\"carrier\":\"502-16\",\"make\":\"Xiaomi\",\"model\":\"HM NOTE 1W\",\"os\":\"Android\",\"osv\":\"4.2\",\"js\":1,\"connectiontype\":5,\"devicetype\":1},\"user\":{\"customdata\":\"2878ecdb-9efa-4faa-80d1-2fb27eea0dd9\"},\"bidCurrency\":[\"USD\"],\"ext\":{\"carriername\":\"unknown - probably WLAN\",\"exchange\":\"smaato\",\"operaminibrowser\":0,\"udi\":{}}}","bidResponseCreative":"{\"itemId\":\"knxad_knx8582_201612124733\",\"campaignId\":\"b229890138f3e2713854ebd7109fbac056856345\",\"htmlSnippet\":\"\\u003cdiv id=\\\"zyu3rr\\\"\\u003e\\u003cscript type=\\\"text/javascript\\\" src=\\\"https://sv.brand-display.com/adedge/api/bd/serving/simple/js?aukey=8697950852009809\\u0026eid=knxad_knx8582_201612124733\\u0026wrap=zyu3rr\\u0026_=%%CACHEBUSTER%%\\u0026encrypt_value=%%ENCRYPT_VALUE%%\\u0026winning_price=${AUCTION_PRICE}\\u0026a_id=%%AUCTION_ID%%\\u0026click=%%CLICK_URL_ESC_ESC%%\\u0026region=%%REGION%%\\u0026agid=%%ADGROUP_ID%%\\\" \\u003e\\u003c/script\\u003e\\u003c/div\\u003e\",\"name\":\"Always_On_Smaato_320x50\",\"formatCode\":\"\",\"bd\":\"\",\"status\":4,\"deleted\":false,\"landingPage\":\"http://www.bestwestern.com/\",\"landingPages\":[\"http://www.bestwestern.com/\"],\"tagging\":null,\"expandingDirection\":-1,\"bdUrl\":\"//cdn.brand-display.com/Singapore/knx8582/knxad_knx8582_201612124733/index.html\",\"format\":{\"code\":\"\",\"name\":\"\",\"publisher\":\"\",\"type\":\"\",\"width\":320,\"height\":50,\"expanded_width\":320,\"expanded_height\":50,\"collapsed_width\":320,\"collapsed_height\":50,\"aspratio\":0,\"expandable\":false,\"expand_first\":false},\"exchangeFilter\":[\"smaato\"],\"budget\":5200}","bidResponseCreativeId":"0","bidResponseCreativeName":"knxad_knx8582_201612124733","bidResponseData":"{\"bids\":[{\"creative\":0,\"ext\":null,\"price\":\"2400USD/1M\",\"priority\":0.90,\"spotIndex\":0}]}","bidResponseMeta":"null","bidWinMeta":"{\"cookieId\":\"aed15458-f9d4-e0f5-a470c31c\",\"serving_price\":0.150}\n","biddingAgentName":"b229890138f3e2713854ebd7109fbac056856345","biddingFullAccount":"b229890138f3e2713854ebd7109fbac056856345:strategy","biddingMainAccount":"b229890138f3e2713854ebd7109fbac056856345","biddingMaxPrice":"2400USD/1M","biddingRequestFormatType":"datacratic","biddingSubAccount":"strategy","impIndex":"0","impressionId":"1","pricePriority":"0.900000","rawWinPrice":"1393USD/1M","timestamp":"2017-Jan-11 00:00:01.21262","userIds":"{\"prov\":\"16371335939681845049\"}","winPrice":"1543USD/1M"}
    {"auctionId":"0xtCErBftZ","bidRequestString":"{\"id\":\"0xtCErBftZ\",\"timestamp\":\"2017-01-11T00:00:02.234Z\",\"isTest\":false,\"url\":\"http://com.hornet.android/\",\"ipAddress\":\"60.51.89.73\",\"userAgent\":\"Mozilla/5.0 (Linux; Android 4.4.2; GT-N7100 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36\",\"exchange\":\"smaato\",\"provider\":\"smaato\",\"location\":{\"countryCode\":\"MYS\",\"regionCode\":\"12\",\"cityName\":\"Ulu Kelang\",\"postalCode\":\"68000\",\"dma\":-1,\"metro\":0,\"timezoneOffsetMinutes\":-1},\"segments\":{\"api-banner\":[\"MRAID-1\",\"MRAID-2\"],\"app-bundle\":[\"com.hornet.android\"],\"device-carrier\":[\"502-16\"],\"device-connection\":[2],\"device-make\":[\"Samsung\"],\"device-model\":[\"GT-N7100\"],\"device-os\":[\"Android\"],\"device-os-version\":[\"4.4\"],\"device-type\":[1],\"iab-categories\":[\"IAB14\",\"IAB14-3\"],\"openrtb-wseat\":[]},\"restrictions\":{\"badv\":[\"https://itunes.apple.com/de/app/blued-gay-social-live-broadcasting/id1090274263?mt=8\",\"https://itunes.apple.com/de/app/radar.tv/id1119912404?mt=8\",\"https://play.google.com/store/apps/details?id=com.blued.international\"],\"bcat\":[\"IAB11\",\"IAB14-1\",\"IAB17-18\",\"IAB22-1\",\"IAB23\",\"IAB24\",\"IAB25\",\"IAB26\",\"IAB3-7\",\"IAB7-28\",\"IAB7-42\",\"IAB8-18\",\"IAB8-5\",\"IAB9-7\",\"IAB9-9\"]},\"userIds\":{\"prov\":\"17620891218148321658\"},\"imp\":[{\"id\":\"1\",\"banner\":{\"w\":320,\"h\":50,\"pos\":0,\"btype\":[1],\"battr\":[1,3,5,8,9],\"mimes\":[\"text/javascript\",\"application/javascript\",\"image/jpeg\",\"image/png\",\"image/gif\"],\"topframe\":0,\"api\":[3,5]},\"displaymanager\":\"SOMA\",\"displaymanagerver\":\"sdkandroid_5-0-6\",\"tagid\":\"130119680\",\"secure\":0,\"ext\":{\"strictbannersize\":0},\"formats\":[\"320x50\"],\"position\":0}],\"spots\":[{\"id\":\"1\",\"banner\":{\"w\":320,\"h\":50,\"pos\":0,\"btype\":[1],\"battr\":[1,3,5,8,9],\"mimes\":[\"text/javascript\",\"application/javascript\",\"image/jpeg\",\"image/png\",\"image/gif\"],\"topframe\":0,\"api\":[3,5]},\"displaymanager\":\"SOMA\",\"displaymanagerver\":\"sdkandroid_5-0-6\",\"tagid\":\"130119680\",\"secure\":0,\"ext\":{\"strictbannersize\":0},\"formats\":[\"320x50\"],\"position\":0}],\"app\":{\"id\":\"130119680\",\"name\":\"HornetNetworks_Hornet_Android_HornetNetworks_Hornet_Android_phone_banner_P_Android_XXLARGE_320x50_IAB14-3,IAB14\",\"domain\":\"play.google.com\",\"cat\":[\"IAB14-3\",\"IAB14\"],\"publisher\":{\"id\":\"1100006659\",\"name\":\"AddApptr GmbH\"},\"bundle\":\"com.hornet.android\"},\"device\":{\"ua\":\"Mozilla/5.0 (Linux; Android 4.4.2; GT-N7100 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36\",\"ip\":\"60.51.89.73\",\"geo\":{\"lat\":3.157384,\"lon\":101.75254,\"country\":\"MYS\",\"region\":\"12\",\"metro\":\"0\",\"city\":\"Ulu Kelang\",\"zip\":\"68000\",\"type\":1},\"carrier\":\"502-16\",\"make\":\"Samsung\",\"model\":\"GT-N7100\",\"os\":\"Android\",\"osv\":\"4.4\",\"js\":1,\"connectiontype\":2,\"devicetype\":1},\"user\":{\"customdata\":\"179c2df0-5cc3-44b6-aba8-feec0544104b\"},\"bidCurrency\":[\"USD\"],\"ext\":{\"carriername\":\"unknown - probably WLAN\",\"exchange\":\"smaato\",\"operaminibrowser\":0,\"udi\":{}}}","bidResponseCreative":"{\"itemId\":\"knxad_knx8582_201612124733\",\"campaignId\":\"b229890138f3e2713854ebd7109fbac056856345\",\"htmlSnippet\":\"\\u003cdiv id=\\\"zyu3rr\\\"\\u003e\\u003cscript type=\\\"text/javascript\\\" src=\\\"https://sv.brand-display.com/adedge/api/bd/serving/simple/js?aukey=8697950852009809\\u0026eid=knxad_knx8582_201612124733\\u0026wrap=zyu3rr\\u0026_=%%CACHEBUSTER%%\\u0026encrypt_value=%%ENCRYPT_VALUE%%\\u0026winning_price=${AUCTION_PRICE}\\u0026a_id=%%AUCTION_ID%%\\u0026click=%%CLICK_URL_ESC_ESC%%\\u0026region=%%REGION%%\\u0026agid=%%ADGROUP_ID%%\\\" \\u003e\\u003c/script\\u003e\\u003c/div\\u003e\",\"name\":\"Always_On_Smaato_320x50\",\"formatCode\":\"\",\"bd\":\"\",\"status\":4,\"deleted\":false,\"landingPage\":\"http://www.bestwestern.com/\",\"landingPages\":[\"http://www.bestwestern.com/\"],\"tagging\":null,\"expandingDirection\":-1,\"bdUrl\":\"//cdn.brand-display.com/Singapore/knx8582/knxad_knx8582_201612124733/index.html\",\"format\":{\"code\":\"\",\"name\":\"\",\"publisher\":\"\",\"type\":\"\",\"width\":320,\"height\":50,\"expanded_width\":320,\"expanded_height\":50,\"collapsed_width\":320,\"collapsed_height\":50,\"aspratio\":0,\"expandable\":false,\"expand_first\":false},\"exchangeFilter\":[\"smaato\"],\"budget\":5200}","bidResponseCreativeId":"0","bidResponseCreativeName":"knxad_knx8582_201612124733","bidResponseData":"{\"bids\":[{\"creative\":0,\"ext\":null,\"price\":\"2400USD/1M\",\"priority\":0.90,\"spotIndex\":0}]}","bidResponseMeta":"null","bidWinMeta":"{\"cookieId\":\"1fee41af-fa88-57d6-790880e9\",\"serving_price\":0.150}\n","biddingAgentName":"b229890138f3e2713854ebd7109fbac056856345","biddingFullAccount":"b229890138f3e2713854ebd7109fbac056856345:strategy","biddingMainAccount":"b229890138f3e2713854ebd7109fbac056856345","biddingMaxPrice":"2400USD/1M","biddingRequestFormatType":"datacratic","biddingSubAccount":"strategy","impIndex":"0","impressionId":"1","pricePriority":"0.900000","rawWinPrice":"1393USD/1M","timestamp":"2017-Jan-11 00:00:03.74890","userIds":"{\"prov\":\"17620891218148321658\"}","winPrice":"1543USD/1M"}
    {"auctionId":"0xha8Jf1SF","bidRequestString":"{\"id\":\"0xha8Jf1SF\",\"timestamp\":\"2017-01-11T00:00:08.202Z\",\"isTest\":false,\"url\":\"http://24.249.62.255/\",\"ipAddress\":\"175.143.199.82\",\"userAgent\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C92\",\"exchange\":\"smaato\",\"provider\":\"smaato\",\"location\":{\"countryCode\":\"MYS\",\"regionCode\":\"14\",\"cityName\":\"Kuala Lumpur\",\"postalCode\":\"59200\",\"dma\":-1,\"metro\":0,\"timezoneOffsetMinutes\":-1},\"segments\":{\"app-bundle\":[418987775],\"device-connection\":[0],\"device-make\":[\"Apple\"],\"device-model\":[\"iPhone\"],\"device-os\":[\"iOS\"],\"device-os-version\":[\"10.2\"],\"device-type\":[1],\"iab-categories\":[\"IAB1\",\"IAB1-6\"],\"openrtb-wseat\":[]},\"restrictions\":{\"badv\":[\"accuradio.com\",\"aharadio.com\",\"audible.com\",\"brighthouse.com\",\"cablevision.com\",\"charter.com\",\"comcast.com\",\"conduit.com\",\"cox.com\",\"deezer.com\",\"direcTV.com\",\"fios.verizon.com\",\"goomradio.com\",\"https://itunes.apple.com/us/radio\",\"iheart.com\",\"internet-radio.com\",\"last.fm\",\"mixcloud.com\",\"mog.com\",\"music.com\",\"pandora.com\",\"qwest.com\",\"radio.com\",\"rdio.com\",\"rhapsody.com\",\"slacker.com\",\"spotify.com\",\"sticher.com\",\"timewarnercable.com\",\"vtuner.com\",\"www.xbox.com/zune\"],\"bcat\":[\"IAB14-1\",\"IAB14-3\",\"IAB17-18\",\"IAB18-2\",\"IAB23\",\"IAB24\",\"IAB25\",\"IAB26\",\"IAB6-7\",\"IAB7-28\",\"IAB7-29\",\"IAB7-3\",\"IAB7-30\",\"IAB7-31\",\"IAB7-39\",\"IAB7-42\",\"IAB8-18\",\"IAB8-5\",\"IAB9-7\",\"IAB9-9\"]},\"userIds\":{\"prov\":\"10348179071565608446\"},\"imp\":[{\"id\":\"1\",\"banner\":{\"w\":320,\"h\":50,\"pos\":0,\"btype\":[1],\"battr\":[1,3,5,6,8,9],\"mimes\":[\"text/javascript\",\"application/javascript\",\"image/jpeg\",\"image/png\",\"image/gif\"],\"topframe\":0},\"displaymanager\":\"SOMA\",\"displaymanagerver\":\"adtag2300s\",\"tagid\":\"130071793\",\"secure\":0,\"ext\":{\"strictbannersize\":0},\"formats\":[\"320x50\"],\"position\":0}],\"spots\":[{\"id\":\"1\",\"banner\":{\"w\":320,\"h\":50,\"pos\":0,\"btype\":[1],\"battr\":[1,3,5,6,8,9],\"mimes\":[\"text/javascript\",\"application/javascript\",\"image/jpeg\",\"image/png\",\"image/gif\"],\"topframe\":0},\"displaymanager\":\"SOMA\",\"displaymanagerver\":\"adtag2300s\",\"tagid\":\"130071793\",\"secure\":0,\"ext\":{\"strictbannersize\":0},\"formats\":[\"320x50\"],\"position\":0}],\"app\":{\"id\":\"130071793\",\"name\":\"Tunein_iOS_Tunein_iOS_320x50_ROW_Tier 1_iOS_XXLARGE_320x50_IAB1-6,IAB1\",\"domain\":\"itunes.apple.com\",\"cat\":[\"IAB1-6\",\"IAB1\"],\"publisher\":{\"id\":\"1100015880\",\"name\":\"Tunein\"},\"bundle\":\"418987775\"},\"device\":{\"dnt\":1,\"ua\":\"Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C92\",\"ip\":\"175.143.199.82\",\"geo\":{\"lat\":3.109227,\"lon\":101.66431,\"country\":\"MYS\",\"region\":\"14\",\"metro\":\"0\",\"city\":\"Kuala Lumpur\",\"zip\":\"59200\",\"type\":1},\"make\":\"Apple\",\"model\":\"iPhone\",\"os\":\"iOS\",\"osv\":\"10.2\",\"js\":1,\"connectiontype\":0,\"devicetype\":1,\"ifa\":\"3EC77F1E-1D66-4106-8067-DF90FD867680\"},\"user\":{},\"bidCurrency\":[\"USD\"],\"ext\":{\"carriername\":\"unknown - probably WLAN\",\"exchange\":\"smaato\",\"operaminibrowser\":0,\"udi\":{\"idfa\":\"3EC77F1E-1D66-4106-8067-DF90FD867680\",\"idfatracking\":0}}}","bidResponseCreative":"{\"itemId\":\"knxad_knx8582_201612124733\",\"campaignId\":\"b229890138f3e2713854ebd7109fbac056856345\",\"htmlSnippet\":\"\\u003cdiv id=\\\"zyu3rr\\\"\\u003e\\u003cscript type=\\\"text/javascript\\\" src=\\\"https://sv.brand-display.com/adedge/api/bd/serving/simple/js?aukey=8697950852009809\\u0026eid=knxad_knx8582_201612124733\\u0026wrap=zyu3rr\\u0026_=%%CACHEBUSTER%%\\u0026encrypt_value=%%ENCRYPT_VALUE%%\\u0026winning_price=${AUCTION_PRICE}\\u0026a_id=%%AUCTION_ID%%\\u0026click=%%CLICK_URL_ESC_ESC%%\\u0026region=%%REGION%%\\u0026agid=%%ADGROUP_ID%%\\\" \\u003e\\u003c/script\\u003e\\u003c/div\\u003e\",\"name\":\"Always_On_Smaato_320x50\",\"formatCode\":\"\",\"bd\":\"\",\"status\":4,\"deleted\":false,\"landingPage\":\"http://www.bestwestern.com/\",\"landingPages\":[\"http://www.bestwestern.com/\"],\"tagging\":null,\"expandingDirection\":-1,\"bdUrl\":\"//cdn.brand-display.com/Singapore/knx8582/knxad_knx8582_201612124733/index.html\",\"format\":{\"code\":\"\",\"name\":\"\",\"publisher\":\"\",\"type\":\"\",\"width\":320,\"height\":50,\"expanded_width\":320,\"expanded_height\":50,\"collapsed_width\":320,\"collapsed_height\":50,\"aspratio\":0,\"expandable\":false,\"expand_first\":false},\"exchangeFilter\":[\"smaato\"],\"budget\":5200}","bidResponseCreativeId":"0","bidResponseCreativeName":"knxad_knx8582_201612124733","bidResponseData":"{\"bids\":[{\"creative\":0,\"ext\":null,\"price\":\"2400USD/1M\",\"priority\":0.90,\"spotIndex\":0}]}","bidResponseMeta":"null","bidWinMeta":"{\"cookieId\":\"50708b7e-ff1d-d096-802fcaf6\",\"serving_price\":0.150}\n","biddingAgentName":"b229890138f3e2713854ebd7109fbac056856345","biddingFullAccount":"b229890138f3e2713854ebd7109fbac056856345:strategy","biddingMainAccount":"b229890138f3e2713854ebd7109fbac056856345","biddingMaxPrice":"2400USD/1M","biddingRequestFormatType":"datacratic","biddingSubAccount":"strategy","impIndex":"0","impressionId":"1","pricePriority":"0.900000","rawWinPrice":"1110USD/1M","timestamp":"2017-Jan-11 00:00:08.89104","userIds":"{\"prov\":\"10348179071565608446\"}","winPrice":"1260USD/1M"}

1 个答案:

答案 0 :(得分:0)

这不是有效的json文件,如果您想正确加载它,可以这样做

import json
data = open(f,'r').readlines()
rst = []
for ele in data:
    rst.append(json.loads(ele))