I can get it if I use text without space after dot
text()='Derzeit nicht verfügbar.'
But sometimes it is simpler to check if it contains expected text.
contains(text(), 'Derzeit nicht verfügbar.')
Testing example
from selenium import webdriver
html = '''
<span class="a-size-medium a-color-price">Derzeit nicht verfügbar.</span>
<span class="a-size-medium a-color-price">Derzeit nicht verfügbar. </span>
<span class="a-size-medium a-color-price"> Derzeit nicht verfügbar. </span>
<div id="availability" class="a-section a-spacing-none }">
<span class="a-size-medium a-color-price">
Derzeit nicht verfügbar.
<div id="all-offers-display" class="a-section">
Other text
'''
driver = webdriver.Firefox()
driver.get("data:text/html;charset=utf-8," + html)
print('\n--- Example 1 - with space ---\n')
all_items = driver.find_elements_by_xpath("//span[@class='a-size-medium a-color-price' and text()='Derzeit nicht verfügbar. ']")
for item in all_items:
print(item.text)
print('---')
print('\n--- Example 2 - without space ---\n')
all_items = driver.find_elements_by_xpath("//span[@class='a-size-medium a-color-price' and text()='Derzeit nicht verfügbar.']")
for item in all_items:
print(item.text)
print('---')
print('\n--- Example 3 - contains ---\n')
all_items = driver.find_elements_by_xpath("//span[@class='a-size-medium a-color-price' and contains(text(), 'Derzeit nicht verfügbar.')]")
for item in all_items:
print(item.text)
print('---')
text()and see what you get. This text in HTML has also spaces, tabs, enters which you don't have intext()='Derzeit nicht verfügbar. '. OR you should use something likecontains(text(), 'Derzeit nicht verfügbar.')'Derzeit nicht verfügbar.'without space after dot.