Extract the text that follows an specific icon

I need to know how to extract the text that follows an specific icon.

Imagine a page where the main features of a house are displayed.

Now, not all houses display all the same features. Some houses display only 3 features, others up to 10.

However, thanks to the icon that precedes the feature, i know exactly what the feature is about.

Here's the CSS:

For example, i would like to extract the text "2 beds" whenever the "beds...png" icon appears and save it with a "beds" id.

The same would go to extract the text "2 baths" whenever the "baths...png" icon appears and save it with a "baths" id.

Thank you very much in advance. Hope i made myself clear.

Your selector has to look like this: img[alt="Beds"] + div . + defines the next element.

Thank you very much Kristaps. I'll give it a try!