Created
April 4, 2022 14:12
-
-
Save saifat29/d436dab5db1e382da0f299675021f2e2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function downloadObjectAsJson(exportObj, exportName){ | |
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj)); | |
var downloadAnchorNode = document.createElement('a'); | |
downloadAnchorNode.setAttribute("href", dataStr); | |
downloadAnchorNode.setAttribute("download", exportName + ".json"); | |
document.body.appendChild(downloadAnchorNode); | |
downloadAnchorNode.click(); | |
downloadAnchorNode.remove(); | |
} | |
var storageObj = Array.from(document.querySelectorAll("#answers-header > div > div.flex--item.fl1")).map(x => x.innerText); | |
downloadObjectAsJson(storageObj, 'transcript'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment