Fixed problem with cset-foretell probabilities

This commit is contained in:
NunoSempere 2021-05-02 16:30:02 +02:00
parent f69814d8e7
commit 9831c86674

View File

@ -44,6 +44,7 @@ async function fetchStats(questionUrl, cookie){
// Is binary?
let isbinary = response.includes("binary?":true")
// console.log(`is binary? ${isbinary}`)
let options = []
if(isbinary){
// Crowd percentage
@ -62,7 +63,7 @@ async function fetchStats(questionUrl, cookie){
type: "PROBABILITY"
}))
}else{
let optionsBody = response.split("tbody")[1]
let optionsBody = response.split("tbody")[3] // Previously [1], but they added a new table.
// console.log(optionsBody)
let optionsHtmlElement = "<table" + optionsBody + "table>"
let tablesAsJson = Tabletojson.convert(optionsHtmlElement)