I mention the process here for you-
First, get the div from the document- const div = document.getElementById("id0");
, you can do this using other methods,
then get all the children of the div, you may do this by const spans = div.children;
, look now spans is HTMLCollection (which is iterable) containing all the spans. Now you iterate over each span and get your textContent and change them using regex/others as you want and put them in a list or others.
The best way to learn from others is to understand the code before copying them.
`
const div = document.getElementById("id0");
const spans = div.children;
for (let i = 0; i < spans.length; i++) {
// here you get each textContent by spans[i].textContent
}
`