Let's say I have the following html:
<div class="targetDiv">
Target text
<div class="junkDiv">
Text I don't want
</div
</div>
I know I can find divs like these and extract all of the text recursively by doing document.getElementsByClassName("thread")[x].innerText
(where x is the index of the div I want to extract from). This will give me "Target textText I don't want".
My question is how do I extract "Target text" without extracting "text I don't want"?