How to scrape before a break?

I'm trying to scrape this piece of html

<h2 class="product-list-title">Widget<br><small>Stuff and Things</small></h2>

Which looks something like this on the page
I want to scrape just the product name separate from the category it belongs to.
Both products and categories can vary in length and word count
This selector: h2.product-list-title
Produces this: Widget Stuff and Things
This selector: h2.product-list-title small
Produces this: Stuff and Things
Any ideas how to produce just "Widget"?

There isn't an easy way how to do this. The problem is that you cannot create a CSS selector that would target a text node. If the "Widget" had a wrapper element then you could select the wrapper element.

Right the best solution would be to scrape the HTML and then parse the data in a post processing phase.

Another simpler but not so stable solution would be to use a regex. Create a text selector that selects the h2 element and use this regex [^\n]+. The regex extracts everything till the first line break.