Created
February 15, 2019 13:13
-
-
Save mig82/4a1b86561ed933c6217676d01baf2235 to your computer and use it in GitHub Desktop.
Extracting links to headers from an Ombud web preview.
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
var baseURL = "https://app.ombud.com/v1/rx/AWQDn7ewgLe6Qjc33rXM/documents/AWjw3gjm4XgXoZ-r27ON/webview_preview"; | |
var entries= document.getElementsByClassName("entry"); | |
var count = entries.length; | |
console.log("Total %d", count); | |
var index = []; | |
for (var i = 0; i < count; i++) { | |
var entry = entries[i]; | |
var question = entry.getElementsByClassName("question")[0].innerText; | |
index.push({ | |
index: i+1, | |
question: question, | |
link: `${baseURL}#${entry.id}` | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment