up
This commit is contained in:
parent
10b921c7c2
commit
a1966e3270
2 changed files with 2 additions and 7 deletions
7
fetch.js
7
fetch.js
|
@ -64,7 +64,6 @@ function getAllAnswersElement(response) {
|
||||||
* @returns {Answer}
|
* @returns {Answer}
|
||||||
*/
|
*/
|
||||||
function parseAnswerElement(index, element, allAnswersElement) {
|
function parseAnswerElement(index, element, allAnswersElement) {
|
||||||
console.log("PARSING AWNSER", {});
|
|
||||||
// Check for Possible Tags
|
// Check for Possible Tags
|
||||||
if (!(element.tagName === "P" || element.tagName === "STRONG")) {
|
if (!(element.tagName === "P" || element.tagName === "STRONG")) {
|
||||||
return;
|
return;
|
||||||
|
@ -90,11 +89,6 @@ function parseAnswerElement(index, element, allAnswersElement) {
|
||||||
const answersElement = getAnswersElement(index, allAnswersElement);
|
const answersElement = getAnswersElement(index, allAnswersElement);
|
||||||
if (answersElement === null || answersElement.tagName === "UL") return;
|
if (answersElement === null || answersElement.tagName === "UL") return;
|
||||||
|
|
||||||
console.log({
|
|
||||||
question: questionText,
|
|
||||||
answers: getAnswers(answersElement),
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
question: questionText,
|
question: questionText,
|
||||||
answers: getAnswers(answersElement),
|
answers: getAnswers(answersElement),
|
||||||
|
@ -122,6 +116,7 @@ function getAnswersElement(index, allAnswersElement) {
|
||||||
if (answersElement.tagName === "P") {
|
if (answersElement.tagName === "P") {
|
||||||
answersElement = allAnswersElement.children[index + 2];
|
answersElement = allAnswersElement.children[index + 2];
|
||||||
}
|
}
|
||||||
|
console.log(answersElement);
|
||||||
return answersElement;
|
return answersElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// @grant GM_setValue
|
// @grant GM_setValue
|
||||||
// @grant GM_getValue
|
// @grant GM_getValue
|
||||||
// @grant GM_xmlhttpRequest
|
// @grant GM_xmlhttpRequest
|
||||||
// @version 0.0.15
|
// @version 0.0.16
|
||||||
// @author Dominik Säume
|
// @author Dominik Säume
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue