From the code below I would like to extract: "I give you €0.00.".
With the following xpath I can target it from Developer tools:
//*[@id="windowID"]/text()[2]
But using Selenium I can only look for this element with driver.findElement(By.Xpath(""))
The problem is that it says that the result of xpath expression is not an element, but an [object Text]
If I target only the ancestor div (windowID), then the whole text is received. I only want the mentioned part to be saved to a string.
<div id="windowID" class="windowClass">"Your are awesome."<br>"I give you €0.00."<br>"But you should give me €0.00."<br>"Would you like to do that?"</div>