title: How to remove special characters from a xpath using Selenium?
body: <p><a href="https://i.stack.imgur.com/gHDiF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gHDiF.png" alt="enter image description here" /></a></p>
  <p>As you are able to see, I have used one dynamic xpath: <code>//td[text()='Discharge Air']/following-sibling::td/span</code> to go from zone1 until zone3, but when I am using gettext() to fetch only 100 but special character °F is also coming. Hence please suggest how to <strong>remove this special character °F</strong>, because I want only data 100 from this xpath? As you can see in the image, only 1 span is available, so I can't separate span also.</p>
  <hr />
  <p>String s = driver.findElement(By.xpath(&quot;//td[text()='Discharge Air']/following-sibling::td/span&quot;)).getText();</p>
  <p>s.replace(&quot;°F&quot;,&quot;&quot;);//replace the °F with empty string</p>
  <p><strong>Instead of String, can i use List because all these xpath are of same type,hence directly i can write and afterwards i can use for loop for getText().</strong></p>
  <p>List s=driver.findElements(By.xpath(&quot;//td[text()='Discharge Air']/following-sibling::td/span&quot;));</p>
  <p>s.replace(&quot;°F&quot;,&quot;&quot;);</p>
  <p>Thanks in advance,</p>