find element by text in between span code example Example: find element by text in between span //span[@class='item_selection_number'][contains(text(),'B')]