2016-05-03 23 views
0

以下に示すスクリプトからjson arraylist部分を抽出する必要があります。私はオンラインで検索しましたが、適切な答えが得られませんでした。 これはスクリプトです:Javaコードを使用してhtmlのスクリプト内でJSON属性を抽出する

<script>var CNN = CNN || {};CNN.contentModel = {       layout:    "no-rail"             , sectionName:  "intl_homepage"            , pageType:   "section"              , env:    "prod"               , type:    "page"              , analytics:  {"pageTop":{},"headline":"","author":"","showName":"","isArticleVideoCollection":false,"publishDate":"2016-05-03T10:32:38Z","pageBranding":"default","chartbeat":{"sections":""},"branding_content_page":"default","branding_content_zone":["default"],"branding_content_container":["default","defining-moments"],"branding_content_card":[""]}             , edition:   "international"              , title:   "CNN - Breaking News, U.S., World, Weather, Entertainment & Video News"             , siblings:   {"articleList":[{"uri":"/2016/05/03/football/leicester-city-150m-windfall/index.html","headline":"Premier League: Title win could net Leicester City $220M","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160314160259-leicester-vardy-mahrez-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/03/sport/sporting-surprises/index.html","headline":"Greatest sporting upsets","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160503093748-riyad-mahrez-celebrates-small-11.jpg","duration":"","description":"Upsets or shock wins in any sport are what put bums on seats and drive television audiences, whether it's a shock K.O. in the ring, or a last-minute goal. ","layout":""},{"uri":"/2016/05/03/football/leicester-city-who-is-claudio-ranieri/index.html","headline":"How coach Ranieri did the impossible","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160503151826-ranieri-tease-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/videos/sports/2016/05/03/five-keys-leicester-city-epl-title-riddell.cnn","headline":"Five keys to their success","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160502200049-five-keys-leicester-city-epl-title-riddle-00013916-small-11.jpg","duration":"02:19","description":"How did the 5,000-to-1 outsiders \u003ca href=\"http://www.cnn.com/2016/05/02/football/leicester-tottenham-chelsea-premier-league-football/index.html\">win the English Premier League\u003c/a>? CNN World Sport's \u003ca href=\"http://www.cnn.com/profiles/don-riddell\">Don Riddell\u003c/a> gives his five keys to their success.","layout":"","iconType":"video"},{"uri":"/2016/05/03/asia/australia-asylum-seeker-fire-nauru/index.html","headline":"Woman sets herself on fire in Australian detention","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160503115653-somali-refugee-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/02/living/endeavour-wreckage-found/index.html","headline":"Greatest nautical mystery solved?","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160503105807-endeavour-replica-small-11.jpg","duration":"","description":"Researchers believe they have found the wreckage of the HMS Endeavour, vessel of legendary British explorer, James Cook.","layout":""},{"uri":"/2016/05/01/politics/donald-trump-indiana-obama-white-house-dinner/index.html","headline":"Trump: I can knock Cruz out","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160502193045-trump-indiana-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/02/politics/osama-bin-laden-raid-architect-mcraven-bergen/index.html","headline":"Bin Laden raid: The anxious moments","thumbnail":"","duration":"","description":"The man who was the architect of the raid that killed Osama bin Laden in the suburbs of a Pakistani city was getting anxious. ","layout":""},{"uri":"/2016/05/03/studentnews/fbi-agent-guilty-plea/index.html","headline":"Ex-FBI agent admits stealing $136,000","thumbnail":"","duration":"","description":"A former FBI agent on Monday admitted to stealing more than $136,000 in drug money which he used to pay for a pair of sports cars and his wife's cosmetic surgery, authorities said.","layout":""},{"uri":"/2016/05/02/world/whatsapp-suspended-brazil/index.html","headline":"Brazil blocks WhatsApp","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160310122634-money-brazil-whatsapp-small-11.jpg","duration":"","description":"A regional judge on Monday ordered all telephone operators in Brazil to block WhatsApp, the popular messaging app owned by Facebook, for failing to turn over data as part of an ongoing drug trafficking investigation. ","layout":""},{"uri":"/2016/05/02/health/three-habitable-planets-earth-dwarf-star/index.html","headline":"Three Earth-like planets found","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160502150914-01-habitable-planets-0502-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/03/asia/barnaby-joyce-carp-herpes/index.html","headline":"Wiping out carp with herpes?","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160503173551-carp-small-11.jpg","duration":"","description":"Not content with telling \u003ca href=\"http://edition.cnn.com/2015/05/14/entertainment/johnny-depp-australia-dog-deadline/\">Jonny Depp's dogs to \"bugger off,\"\u003c/a> Australia's new Deputy Prime Minister Barnaby Joyce has moved onto his next target ... carp.","layout":""},{"uri":"/2016/05/03/foodanddrink/naked-restaurant-bunyadi-london/index.html","headline":"32,000 sign up for nude restaurant","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160429182650-spencer-tunick-photo-shoot-small-11.jpg","duration":"","description":"Pop-up eatery opens in summer. But limited space means not everyone will be undressing for dinner","layout":""},{"uri":"/2016/05/02/aviation/crystal-cruises-airline-fleet/index.html","headline":"Like a luxury cruise ship at 30,000 feet ","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160429155420-crystal-air-777--787-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/02/luxury/geneva-watch-auction-epic-chronographs/index.html","headline":"10 epic watches to invest in now","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160426120115-rolex-jean-claude-killy-tease-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/02/fashion/iris-van-herpen-manus-x-machina/index.html","headline":"Is THIS how we'll dress is 2050?","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160429124645-iris-van-herpen-haute-couture-aw13-small-11.jpg","duration":"","description":"\"I will show you the dragon skin dress.\" ","layout":""},{"uri":"/2016/05/02/politics/cnn-orc-poll-hillary-clinton-donald-trump/index.html","headline":"CNN poll: It'll be Trump v. Clinton","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160427120428-clinton-trump-t1-split-0427-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/02/travel/us-cuba-cruise/index.html","headline":"U.S. cruise docks in Havana after decades","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160502173957-us-cuba-cruise-ship-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/03/health/teens-cell-phone-addiction-parents/index.html","headline":"Half of teens 'addicted to smartphones'","thumbnail":"","duration":"","description":"I don't have teenagers yet, but watching my 8- and 10-year-olds spend endless amounts of time on iPads during spring break makes me worried about the day -- hopefully years from now -- when they have their own devices.","layout":""},{"uri":"/2016/05/02/politics/terrorism-bin-laden-raid-2016-isis/index.html","headline":"Did killing bin Laden achieve anything?","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/150727105141-osama-bin-laden-file-1998-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/05/03/health/meningitis-elimination-vaccine/index.html","headline":"Deadly disease about to be wiped out?","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/131203135202-bacterial-meningitis-small-11.jpg","duration":"","description":"A vaccine against Meningitis A has dramatically reduced numbers of infections in Africa, but other strains of the disease are still present, experts warn.","layout":""},{"uri":"/2016/05/02/motorsport/toto-wolff-lewis-hamilton-mercedes-russian-grand-prix-sochi/index.html","headline":"F1: Mercedes boss blasts 'lunatic' theories","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160430133841-lewis-hamilton-sochi-1-small-11.jpg","duration":"","description":"Mercedes boss Toto Wolff has hit out at the \"bunch of lunatics\" putting forward \"conspiracy theories\" that the team is sabotaging Lewis Hamilton's chances this season.","layout":""},{"uri":"/2016/04/30/politics/white-house-correspondents-dinner-obama-best-lines/index.html","headline":"Mic drop: Obama's best lines","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160501054104-obama-2016-whcd-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/videos/world/2016/05/02/australia-large-baby-born-dnt.seven-network","headline":"Woman gives birth to 13-pound baby","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160502034632-australia-large-baby-born-dnt-00001126-small-11.jpg","duration":"01:16","description":"An Australian woman has given birth to a baby boy weighing 13 pounds 2 ounces or 5.8kg, making him one of the heaviest babies ever born in Western Australia. \u003ca href=\"https://au.news.yahoo.com/\" target=\"_blank\">Seven Network\u003c/a> reports.","layout":"","iconType":"video"},{"uri":"/videos/us/2016/04/29/florida-man-clings-to-car-road-rage-dnt.wplg","headline":"Shocking road rage incident on camera","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160429075559-florida-man-clings-to-car-road-rage-small-11.jpg","duration":"01:05","description":"Witnesses say a road rage incident lead to a man clinging to the hood of a moving car. Police did not have enough information to investigate the incident. \u003ca href=\"http://www.local10.com/\" target=\"_blank\">WPLG\u003c/a>'s Victor Oquendo reports.","layout":"","iconType":"video"},{"uri":"/2016/04/20/opinions/sutter-stop-ruining-the-future/index.html","headline":"Stop ruining the future","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160224140932-miami-flood-climate-change-2015-small-11.jpg","duration":"","description":"Climate change can seem so big it's impossible to fix. ","layout":""},{"uri":"/2016/04/20/arts/mathieu-kassovitz-alone-in-the-louvre/index.html","headline":"What's it like being alone in the Louvre? ","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/151218123049-pg-louvre-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/04/12/middleeast/isis-taliban-afghanistan-defectors/index.html","headline":"Former Taliban fighters flee ISIS brutality","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160411231323-afghanistan-isis-defectors-paton-walsh-pkg-00011408-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/04/18/africa/looting-machine-tom-burgis-africa/index.html","headline":"The continent that's the richest and poorest","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160414123831-congo-gold-mine-small-11.jpg","duration":"","description":"","layout":""},{"uri":"/2016/04/13/asia/china-teen-brides/index.html","headline":"Meet China's teen brides","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160317153156-china-teen-brides-7-small-11.jpg","duration":"","description":"Thirteen and just married, Jie looks at her wedding picture framed in white. Next to it, incongruously, are stickers from the Pixar movie \"Cars.\" ","layout":""},{"uri":"/2016/03/08/asia/fukushima-five-year-anniversary/index.html","headline":"The legacy of Japan's nuclear disaster","thumbnail":"http://i2.cdn.turner.com/cnnnext/dam/assets/160308152849-fukushima-destroyed-tease-small-11.jpg","duration":"","description":"Soichi Saito was in hospital when the earthquake hit. ","layout":""}]}      , registryURL: "http://z.cdn.turner.com/ads/cnni/cnni_homepage.js", entitlementSingletons: [{"id":"ad_mod_85a882a72","scriptName":"http://z.cdn.turner.com/ads/cnni/singles/cnni_entitlement_01.js"},{"id":"ad_mod_e74dbd68d","scriptName":"http://z.cdn.turner.com/ads/cnni/singles/cnni_entitlement_02.js"},{"id":"ad_mod_596291844","scriptName":"http://z.cdn.turner.com/ads/cnni/singles/cnni_entitlement_03.js"},{"id":"ad_mod_9a979d11","scriptName":"http://z.cdn.turner.com/ads/cnni/singles/cnni_entitlement_04.js"},{"id":"ad_mod_2b3ba0432","scriptName":"http://z.cdn.turner.com/ads/cnni/singles/cnni_entitlement_05.js"}]      , zoneIds:     ["intl_homepage1-zone-1","intl_homepage1-zone-2","intl_homepage1-zone-3","intl_homepage1-zone-4","intl_homepage2-zone-1","intl_homepage3-zone-1","intl_homepage3-zone-3","intl_homepage3-zone-4"]             , lazyLoad:    true         , feedback:    {"apiEndpoint":"https://mailcar.cnn.com/api/v1/"}   };</script> 

私はこのことからJSONの配列リストを抽出する必要があります。すなわち、 :

{ 
"articleList": [{ 
    "uri": "/2016/05/03/football/leicester-city-150m-windfall/index.html", 
    "headline": "Premier League: Title win could net Leicester City $220M", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160314160259-leicester-vardy-mahrez-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/sport/sporting-surprises/index.html", 
    "headline": "Greatest sporting upsets", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160503093748-riyad-mahrez-celebrates-small-11.jpg", 
    "duration": "", 
    "description": "Upsets or shock wins in any sport are what put bums on seats and drive television audiences, whether it's a shock K.O. in the ring, or a last-minute goal. ", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/football/leicester-city-who-is-claudio-ranieri/index.html", 
    "headline": "How coach Ranieri did the impossible", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160503151826-ranieri-tease-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/videos/sports/2016/05/03/five-keys-leicester-city-epl-title-riddell.cnn", 
    "headline": "Five keys to their success", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160502200049-five-keys-leicester-city-epl-title-riddle-00013916-small-11.jpg", 
    "duration": "02:19", 
    "description": "How did the 5,000-to-1 outsiders \u003ca href=\"http://www.cnn.com/2016/05/02/football/leicester-tottenham-chelsea-premier-league-football/index.html\">win the English Premier League\u003c/a>? CNN World Sport's \u003ca href=\"http://www.cnn.com/profiles/don-riddell\">Don Riddell\u003c/a> gives his five keys to their success.", 
    "layout": "", 
    "iconType": "video" 
}, { 
    "uri": "/2016/05/03/asia/australia-asylum-seeker-fire-nauru/index.html", 
    "headline": "Woman sets herself on fire in Australian detention", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160503115653-somali-refugee-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/living/endeavour-wreckage-found/index.html", 
    "headline": "Greatest nautical mystery solved?", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160503105807-endeavour-replica-small-11.jpg", 
    "duration": "", 
    "description": "Researchers believe they have found the wreckage of the HMS Endeavour, vessel of legendary British explorer, James Cook.", 
    "layout": "" 
}, { 
    "uri": "/2016/05/01/politics/donald-trump-indiana-obama-white-house-dinner/index.html", 
    "headline": "Trump: I can knock Cruz out", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160502193045-trump-indiana-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/politics/osama-bin-laden-raid-architect-mcraven-bergen/index.html", 
    "headline": "Bin Laden raid: The anxious moments", 
    "thumbnail": "", 
    "duration": "", 
    "description": "The man who was the architect of the raid that killed Osama bin Laden in the suburbs of a Pakistani city was getting anxious. ", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/studentnews/fbi-agent-guilty-plea/index.html", 
    "headline": "Ex-FBI agent admits stealing $136,000", 
    "thumbnail": "", 
    "duration": "", 
    "description": "A former FBI agent on Monday admitted to stealing more than $136,000 in drug money which he used to pay for a pair of sports cars and his wife's cosmetic surgery, authorities said.", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/world/whatsapp-suspended-brazil/index.html", 
    "headline": "Brazil blocks WhatsApp", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160310122634-money-brazil-whatsapp-small-11.jpg", 
    "duration": "", 
    "description": "A regional judge on Monday ordered all telephone operators in Brazil to block WhatsApp, the popular messaging app owned by Facebook, for failing to turn over data as part of an ongoing drug trafficking investigation. ", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/health/three-habitable-planets-earth-dwarf-star/index.html", 
    "headline": "Three Earth-like planets found", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160502150914-01-habitable-planets-0502-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/asia/barnaby-joyce-carp-herpes/index.html", 
    "headline": "Wiping out carp with herpes?", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160503173551-carp-small-11.jpg", 
    "duration": "", 
    "description": "Not content with telling \u003ca href=\"http://edition.cnn.com/2015/05/14/entertainment/johnny-depp-australia-dog-deadline/\">Jonny Depp's dogs to \"bugger off,\"\u003c/a> Australia's new Deputy Prime Minister Barnaby Joyce has moved onto his next target ... carp.", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/foodanddrink/naked-restaurant-bunyadi-london/index.html", 
    "headline": "32,000 sign up for nude restaurant", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160429182650-spencer-tunick-photo-shoot-small-11.jpg", 
    "duration": "", 
    "description": "Pop-up eatery opens in summer. But limited space means not everyone will be undressing for dinner", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/aviation/crystal-cruises-airline-fleet/index.html", 
    "headline": "Like a luxury cruise ship at 30,000 feet ", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160429155420-crystal-air-777--787-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/luxury/geneva-watch-auction-epic-chronographs/index.html", 
    "headline": "10 epic watches to invest in now", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160426120115-rolex-jean-claude-killy-tease-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/fashion/iris-van-herpen-manus-x-machina/index.html", 
    "headline": "Is THIS how we'll dress is 2050?", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160429124645-iris-van-herpen-haute-couture-aw13-small-11.jpg", 
    "duration": "", 
    "description": "\"I will show you the dragon skin dress.\" ", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/politics/cnn-orc-poll-hillary-clinton-donald-trump/index.html", 
    "headline": "CNN poll: It'll be Trump v. Clinton", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160427120428-clinton-trump-t1-split-0427-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/travel/us-cuba-cruise/index.html", 
    "headline": "U.S. cruise docks in Havana after decades", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160502173957-us-cuba-cruise-ship-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/health/teens-cell-phone-addiction-parents/index.html", 
    "headline": "Half of teens 'addicted to smartphones'", 
    "thumbnail": "", 
    "duration": "", 
    "description": "I don't have teenagers yet, but watching my 8- and 10-year-olds spend endless amounts of time on iPads during spring break makes me worried about the day -- hopefully years from now -- when they have their own devices.", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/politics/terrorism-bin-laden-raid-2016-isis/index.html", 
    "headline": "Did killing bin Laden achieve anything?", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/150727105141-osama-bin-laden-file-1998-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/05/03/health/meningitis-elimination-vaccine/index.html", 
    "headline": "Deadly disease about to be wiped out?", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/131203135202-bacterial-meningitis-small-11.jpg", 
    "duration": "", 
    "description": "A vaccine against Meningitis A has dramatically reduced numbers of infections in Africa, but other strains of the disease are still present, experts warn.", 
    "layout": "" 
}, { 
    "uri": "/2016/05/02/motorsport/toto-wolff-lewis-hamilton-mercedes-russian-grand-prix-sochi/index.html", 
    "headline": "F1: Mercedes boss blasts 'lunatic' theories", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160430133841-lewis-hamilton-sochi-1-small-11.jpg", 
    "duration": "", 
    "description": "Mercedes boss Toto Wolff has hit out at the \"bunch of lunatics\" putting forward \"conspiracy theories\" that the team is sabotaging Lewis Hamilton's chances this season.", 
    "layout": "" 
}, { 
    "uri": "/2016/04/30/politics/white-house-correspondents-dinner-obama-best-lines/index.html", 
    "headline": "Mic drop: Obama's best lines", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160501054104-obama-2016-whcd-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/videos/world/2016/05/02/australia-large-baby-born-dnt.seven-network", 
    "headline": "Woman gives birth to 13-pound baby", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160502034632-australia-large-baby-born-dnt-00001126-small-11.jpg", 
    "duration": "01:16", 
    "description": "An Australian woman has given birth to a baby boy weighing 13 pounds 2 ounces or 5.8kg, making him one of the heaviest babies ever born in Western Australia. \u003ca href=\"https://au.news.yahoo.com/\" target=\"_blank\">Seven Network\u003c/a> reports.", 
    "layout": "", 
    "iconType": "video" 
}, { 
    "uri": "/videos/us/2016/04/29/florida-man-clings-to-car-road-rage-dnt.wplg", 
    "headline": "Shocking road rage incident on camera", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160429075559-florida-man-clings-to-car-road-rage-small-11.jpg", 
    "duration": "01:05", 
    "description": "Witnesses say a road rage incident lead to a man clinging to the hood of a moving car. Police did not have enough information to investigate the incident. \u003ca href=\"http://www.local10.com/\" target=\"_blank\">WPLG\u003c/a>'s Victor Oquendo reports.", 
    "layout": "", 
    "iconType": "video" 
}, { 
    "uri": "/2016/04/20/opinions/sutter-stop-ruining-the-future/index.html", 
    "headline": "Stop ruining the future", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160224140932-miami-flood-climate-change-2015-small-11.jpg", 
    "duration": "", 
    "description": "Climate change can seem so big it's impossible to fix. ", 
    "layout": "" 
}, { 
    "uri": "/2016/04/20/arts/mathieu-kassovitz-alone-in-the-louvre/index.html", 
    "headline": "What's it like being alone in the Louvre? ", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/151218123049-pg-louvre-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/04/12/middleeast/isis-taliban-afghanistan-defectors/index.html", 
    "headline": "Former Taliban fighters flee ISIS brutality", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160411231323-afghanistan-isis-defectors-paton-walsh-pkg-00011408-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/04/18/africa/looting-machine-tom-burgis-africa/index.html", 
    "headline": "The continent that's the richest and poorest", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160414123831-congo-gold-mine-small-11.jpg", 
    "duration": "", 
    "description": "", 
    "layout": "" 
}, { 
    "uri": "/2016/04/13/asia/china-teen-brides/index.html", 
    "headline": "Meet China's teen brides", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160317153156-china-teen-brides-7-small-11.jpg", 
    "duration": "", 
    "description": "Thirteen and just married, Jie looks at her wedding picture framed in white. Next to it, incongruously, are stickers from the Pixar movie \"Cars.\" ", 
    "layout": "" 
}, { 
    "uri": "/2016/03/08/asia/fukushima-five-year-anniversary/index.html", 
    "headline": "The legacy of Japan's nuclear disaster", 
    "thumbnail": "http://i2.cdn.turner.com/cnnnext/dam/assets/160308152849-fukushima-destroyed-tease-small-11.jpg", 
    "duration": "", 
    "description": "Soichi Saito was in hospital when the earthquake hit. ", 
    "layout": "" 
}] 

}

どのように私はこれを達成することができます。私はこのjsonを変換し、javaコードを使用してこれを解析する必要があります。しかし、そのためには、このスクリプトからjson文字列を取得する必要があります。誰かが

+1

CNN変数から "articleList"配列を抽出する場合は、次のように使用する必要があります。 var arrList = JSON.stringify(CNN.contentModel.siblings.articleList); –

+0

@ M.Diachenko:しかし、このElementオブジェクト(上に表示されているスクリプト)からJavaコードを使用してCNN変数を取得していますか? –

答えて

0

は、以下のように、この使用して正規表現を行うことができた私を助けることができます。質問に示すよう

private static String getJsonString(String str1) { 
    String patternString1 = "(\\{\"articleList\"(.)*]\\})"; 

    Pattern pattern = Pattern.compile(patternString1); 
    Matcher matcher = pattern.matcher(str1); 
    while(matcher.find()) { 
     System.out.println("Helloo"); 
     System.out.println("found: <" + matcher.group() + 
       ">");   
     return matcher.group(); 
    } 

    // TODO Auto-generated method stub 
    return null; 
} 

これは必須JSON文字列を返します。これから、私は必要な値を解析して取ることができました。

関連する問題