title: Selenium Java - how to extract a number from a html through Selenium
body: <p>I need to extract a number (Code) from a html. I have the next String that extract all in html:</p>
  
  <pre><code>String value = driver.findElement(By.xpath("//*[@id=\"htmlSourceContent\"]")).getText();
  </code></pre>
  
  <p>I just want to extract the code (numbers)</p>
  
  <p>This is the html:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;style&gt;
        /* Email styles need to be inline */
      &lt;/style&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;h1&gt;Security Code&lt;/h1&gt;
  
  &lt;p&gt;
    Please enter the code &lt;b&gt;394013&lt;/b&gt;.
  &lt;/p&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>That code is random <code>&lt;b&gt;394013&lt;/b&gt;.</code></p>