How to scrape text from parent but not from child?

The page I'm trying to scrape has HTML like:

<td>
text here that I want to scrape
<div class="some-custom-class">
bunch of stuff here that I want to exclude from the scrape
</div>
</td>

I can't figure out how to select just the text directly in the <td> without including everything in the <div>. I guess it's impossible because CSS, by design, cascades? So if I select the <td> I'm also selecting all of its children?