Python/Selenium: Whitespace issue when retrieving text content from XPath (normalize-space)
Question: I am having some difficulties with a relative `XPath` web scraper
implementation with `Selenium` for `Python`.

From this [Börse Frankfurt web page](http://www.boerse-frankfurt.de/etp/db-x-
trackers-STOXX-GLOBAL-SELECT-DIVIDEND-100-UCITS-ETF-1D-LU0292096186), I want
to get the text in the cell adjacent to `<td> UCITS IV-Konform </td>`, namely
the text in the cell that says `<td class="text-right"> Ja </td>`.

I have tested the XPath I'm using with
[Freeformatter](http://www.freeformatter.com/xpath-tester.html#ad-output)
which states that my XPath is correct.

Navigation to the page works fine. However, when I try to retrieve the text
content, I get `None`. Apparently, it's not finding the XPath.

**Post-answer edit** : The issue is due to _whitespace_ leading/trailing the
text content.

* * *
    
    
    from selenium import webdriver
    from selenium.common.exceptions import NoSuchElementException
    
    driver = webdriver.Firefox()
    driver.get("http://www.boerse-frankfurt.de/etp/db-x-trackers-STOXX-GLOBAL-SELECT-DIVIDEND-100-UCITS-ETF-1D-LU0292096186")
    
    try:
        find_value = driver.find_element_by_xpath("//td[text()=' UCITS IV-Konform ']/following-sibling::td").text
    except NoSuchElementException:
        find_value = None
    
    print find_value
    


Answer: Try the XPath `"//td[normalize-space(.) = 'UCITS IV-Konform']/following-
sibling::td"` as I think there is a lot of leading and trailing white space in
that cell.

