After attempting to access the "description" from the json data at the following URL: using a PhantomJS script, I encountered a specific issue. Below is a snippet of the script I used:
steps = [
/*
* Step 1 - print out description
*/
function(){
page.open( 'https://librivox.org/api/feed/audiobooks/id/11591/extended/1/format/json' , function () {
var jsonSource = page.plainText;
//console.log( jsonSource );
var resultObject = JSON.parse(jsonSource);
var bookkey = Object.keys(resultObject.books);
console.log( bookkey );
console.log( resultObject.books.bookkey );
});
},
];
Upon running the script, the output I received was as follows:
14
undefined
My challenge lies in figuring out how to access the description value from the JSON data. Here is a snippet of the JSON content retrieved from the mentioned URL:
{"books":{"14":{"id":"11591","title":"Soldier Of The Legion; <br>An Englishman's Adventures Under The French Flag in Algeria And Tonquin","description":"An educated gentleman, Mr Manington has given an insight into the unusual experiences of an Englishman in the French Foreign Legion, such as no ordinary \"mercenary\" could have done. Most of the narrative deals with Tonquin, and the fighting there against the rebels in their forest fastnesses. Incidentally, in giving an account of his friendship for the native sergeant, Doy-Tho, the author has been able to impart to the pages of the book an Oriental atmosphere that we think will prove attractive to the reader. - Summary by Editors' Note","url_text_source":"http:\/\/www.gutenberg.org\/ebooks\/53902","language":"English","copyright_year":"1907","num_sections":"15","url_rss":"http:\/\/librivox.org\/rss\/11591","url_zip_file":"http:\/\/www.archive.org\/download\/\/a_soldier_of_the_legion_1702_librivox\/a_soldier_of_the_legion_1702_librivox_64kb_mp3.zip","url_project":"","url_librivox":"http:\/\/librivox.org...