Last active
July 20, 2019 05:00
-
-
Save DylanCh/63fe5e95bbc8756074a69f9544450861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://json.org/example.html') | |
.then( x => x.text()) | |
.then(function(html){ | |
var parser = new DOMParser(); | |
var doc = parser.parseFromString(html, "text/html"); | |
var pre = doc.querySelector('pre'); | |
var obj = JSON.parse(pre.innerHTML); | |
console.log(obj.glossary.GlossDiv.GlossList.GlossEntry.GlossDef.GlossSeeAlso[0]) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment