###前提・実現したいこと
pythonで、JSONファイルから辞書型をを作り、その中から値を取り出して、URLにつなげることをやりたいと思っています。JSONファイルから取り出すことはできたのですが、そこから特定の値が入った物だけを別の関数に入れるやり方がわかりません。URLはできました。
###該当のソースコード
python
1import json 2 3 4f = open('url.json','r') 5json_dict = json.load(f) 6print(format(json_dict['items']))
json
1 2items = [ 3 { 4 "kind": "books#volume", 5 "id": "ldSFRJaVbxAC", 6 "etag": "sjGC/Bii148", 7 "selfLink": "https://www.googleapis.com/books/v1/volumes/ldSFRJaVbxAC", 8 "volumeInfo": { 9 "title": "On the Job", 10 "subtitle": "Confronting the Labour Process in Canada", 11 "authors": [ 12 "Craig Heron", 13 "Robert H. Storey" 14 ], 15 "publisher": "McGill-Queen's Press - MQUP", 16 "publishedDate": "1986-01-01", 17 "description": "Every day millions of Canadians go out to work. They labour in factories, offices, restaurants, and retail stores, on ships, and deep in mines. And every day millions of other Canadians, mostly women, begin work in their homes, performing the many tasks that ensure the well-being of their families and ultimately, the reproduction of the paid labour force. Yet, for all its undoubted importance, there has been remarkably little systematic research into the past and present dynamics of the world of work in Canada.", 18 "industryIdentifiers": [ 19 { 20 "type": "ISBN_10", 21 "identifier": "0773505997" 22 }, 23 { 24 "type": "ISBN_13", 25 "identifier": "9780773505995" 26 } 27 ], 28 "readingModes": { 29 "text": false, 30 "image": true 31 }, 32 "pageCount": 360, 33 "printType": "BOOK", 34 "categories": [ 35 "Law" 36 ], 37 "maturityRating": "NOT_MATURE", 38 "allowAnonLogging": false, 39 "contentVersion": "preview-1.0.0", 40 "imageLinks": { 41 "smallThumbnail": "http://books.google.com/books/content?id=ldSFRJaVbxAC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api", 42 "thumbnail": "http://books.google.com/books/content?id=ldSFRJaVbxAC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api" 43 }, 44 "language": "en", 45 "previewLink": "http://books.google.co.jp/books?id=ldSFRJaVbxAC&printsec=frontcover&dq=job&hl=&cd=1&source=gbs_api", 46 "infoLink": "http://books.google.co.jp/books?id=ldSFRJaVbxAC&dq=job&hl=&source=gbs_api", 47 "canonicalVolumeLink": "https://books.google.com/books/about/On_the_Job.html?hl=&id=ldSFRJaVbxAC" 48 }, 49 "saleInfo": { 50 "country": "JP", 51 "saleability": "NOT_FOR_SALE", 52 "isEbook": false 53 }, 54 "accessInfo": { 55 "country": "JP", 56 "viewability": "PARTIAL", 57 "embeddable": true, 58 "publicDomain": false, 59 "textToSpeechPermission": "ALLOWED", 60 "epub": { 61 "isAvailable": false 62 }, 63 "pdf": { 64 "isAvailable": true, 65 "acsTokenLink": "http://books.google.co.jp/books/download/On_the_Job-sample-pdf.acsm?id=ldSFRJaVbxAC&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api" 66 }, 67 "webReaderLink": "http://play.google.com/books/reader?id=ldSFRJaVbxAC&hl=&printsec=frontcover&source=gbs_api", 68 "accessViewStatus": "SAMPLE", 69 "quoteSharingAllowed": false 70 }, 71 "searchInfo": { 72 "textSnippet": "Yet, for all its undoubted importance, there has been remarkably little systematic research into the past and present dynamics of the world of work in Canada." 73 } 74 ]
json
1"industryIdentifiers": [ 2 { 3 "type": "ISBN_10", 4 "identifier": "0773505997" 5 }, 6 { 7 "type": "ISBN_13", 8 "identifier": "9780773505995" 9 } 10 ]
この"industryIdentifiers"の、"identifier": "0773505997"の値を撮りたいです。
###試したこと
辞書型の中身を取るやり方をやって見ましたが、うまくいきませんでした。
###補足情報(言語/FW/ツール等のバージョンなど)
python3.5.1
ご教授願います。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。