Last active
May 10, 2025 09:53
-
-
Save geraldotech/e8330204f7c2629b07c4af72383c0b5c to your computer and use it in GitHub Desktop.
Estacio2024
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
// get all questions || or gabarito answers | |
const title = document.querySelectorAll("[data-testid='question-typography']:first-child") | |
for(const i of title){ | |
console.log(i.textContent) | |
console.log("=============") | |
} | |
// get all questions || or gabarito answers com index | |
const title = document.querySelectorAll("[data-testid='question-typography']:first-child") | |
for(const [i, value] of title.entries()){ | |
console.log(i + 1, value.textContent) | |
console.log("=============") | |
} | |
// get all answers only | |
const resp = document.querySelectorAll("[data-element='link_resposta'] [data-testid='question-typography']") | |
resp.forEach((val) => { | |
console.log(val.textContent) | |
console.log("=============") | |
}) | |
// === Download all question in a questions.txt file === | |
const titles = document.querySelectorAll("[data-testid='question-typography']:first-child"); | |
let combinedContent = ""; | |
// Loop through all the selected elements to accumulate their content | |
titles.forEach(title => { | |
combinedContent += title.textContent + "\n"; | |
combinedContent += "=====================\n"; | |
}); | |
// Create a Blob containing all the accumulated content | |
const file = new Blob([combinedContent], { type: "text/plain" }); | |
// Create a link to download the Blob as a file | |
const a = document.createElement("a"); | |
a.setAttribute("href", URL.createObjectURL(file)); | |
a.setAttribute("download", "questions.txt"); | |
// Trigger the download by programmatically clicking the link | |
a.click(); | |
// Clean up | |
URL.revokeObjectURL(a.getAttribute("href")); | |
// === Download all answers in a answers.txt file === | |
const resp = document.querySelectorAll("[data-element='link_resposta'] [data-testid='question-typography']") | |
let combinedContent = ""; | |
// Loop through all the selected elements to accumulate their content | |
resp.forEach(title => { | |
combinedContent += title.textContent + "\n"; | |
}); | |
// Create a Blob containing all the accumulated content | |
const file = new Blob([combinedContent], { type: "text/plain" }); | |
// Create a link to download the Blob as a file | |
const a = document.createElement("a"); | |
a.setAttribute("href", URL.createObjectURL(file)); | |
a.setAttribute("download", "answers.txt"); | |
// Trigger the download by programmatically clicking the link | |
a.click(); | |
// Clean up | |
URL.revokeObjectURL(a.getAttribute("href")); |
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
/*Pegar todo conteúdo de uma página apenas para assinantes | |
Exemplo: https://oglobo.globo.com/politica/noticia/2023/01/lira-convoca-sessao-extraordinaria-para-camara-analisar-nesta-noite-decreto-de-intervencao-no-df.ghtml | |
by: gmapdev | |
*/ | |
Abrir console> CTRL + SHIFT + p: type JavaScript para desabilitar | |
ou pegar somente o conteudo de text: | |
const content = document.querySelectorAll(".content-text__container"); | |
content.forEach((item) => { | |
let novo = open() | |
for(const i of content){ | |
novo.document.write(i.innerHTML, '<br>') | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment