How to capture/scrap alternative text from the webpage

I am currently struggling to do so, I see the ui elements have some differences

I want to pick these elements having class="break-words space-y-1"

But i am not sure how to filter specific items ?