Created
July 3, 2023 07:51
-
-
Save WeslyG/b8926de4ddc93bc929d1b98718553112 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
// for https://ui.gitlab-pages.kontur.host/docs/#/icons | |
const data = Array.from(document.querySelectorAll("[data-testid='mountNode']")[2].childNodes[2].children).filter( | |
i => i.localName === "div" | |
); | |
const result = []; | |
let idx = 0; | |
Array.from(data).forEach(a => { | |
Array.from(a.children[0].children).map(i => result.push([i.querySelector("p").innerText.replace(/[\u200b]/, "")])); | |
}); | |
Array.from(data).forEach(a => { | |
Array.from(a.children[1].children).map(i => { | |
result[idx].push(i.querySelector("p").innerText.replace(/[\u200b]/, "")); | |
idx++; | |
}); | |
}); | |
console.log(Object.fromEntries(result)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment