there's this website that conjugates korean verbs https://www.verbix.com/languages/korean. What i wanna do is type something in the input and then get the text of the suggestion that appears.
That blue part is the 'a' element's text
This is my code:
app.get("/conjugation", (req, res) => {
axios("https://www.verbix.com/languages/korean")
.then((response) => {
const htmlData = response.data;
const $ = cheerio.load(htmlData);
//Input Element
const input = $("#auto-complete-edit");
//Pass the value to it
input.attr("value", "먹어요");
//Get the selected element
const select = $(".selected");
select
.map((i, child) => {
//Get the 'a' element inner text
return $(child).find("a").text();
})
.get();
console.log(select);
})
.catch((err) => console.log(err));
});
And the console shows this
LoadedCheerio {
length: 0,
options: { xml: false, decodeEntities: true },
_root: <ref *1> LoadedCheerio {
'0': Document {
parent: null,
prev: null,
next: null,
startIndex: null,
endIndex: null,
children: [Array],
type: 'root',
'x-mode': 'no-quirks'
},
length: 1,
options: { xml: false, decodeEntities: true },
_root: [Circular *1]
},
prevObject: <ref *2> LoadedCheerio {
'0': Document {
parent: null,
prev: null,
next: null,
startIndex: null,
endIndex: null,
children: [Array],
type: 'root',
'x-mode': 'no-quirks'
},
length: 1,
options: { xml: false, decodeEntities: true },
_root: [Circular *2]
}
}