0
嗨,我是從一個SOAP服務獲得的數據和轉換XML到JSON和獲取我需要這樣的價值:Lodash深挑
console.log(result['soap:Envelope']['soap:Body']['ns2:getFichaGeneralResponse']['return']['instituciones']['datosPrincipales']['registros'][1].valor)
有沒有辦法做這樣的事情?
console.log(_.pick(result, 'registros'))
因此,我可以得到一個對象與我需要的信息?
如何看起來'result'變量?它的結構是什麼?此console.log拋出一個錯誤'console.log(result ['soap:Envelope'] ['soap:Body'] ['ns2:getFichaGeneralResponse'] ['return'] ['instituciones'] ['datosPrincipales'] [ 'registros'] [1] .valor)' –