I use selenium to get text on my webpage using xpath.
The structure of the page tag is as follows:
<span id="data" class="firefinder-match"> Seat Height, Laden <sup> <a class="speckeyfootnote" rel="p7" href="#">7</a> </sup> </span>
If I use the following code -
driver.findElement(By.xpath("//span[@id='data']")).getText();
I get the result = Seat Height, Laden 7
But I want to avoid reading the text in the <sup>
tags and get the result Seat Height, Laden
Please let me know which xpath expression I can use to get the desired result.
source share