title: How to access various parts of a link with XPath
body: <p>I'm fairly new to XPath and wanted to see how granular you can get when accessing various HTML components. </p>
  
  <p>I'm currently using the this xpath</p>
  
  <pre><code>//*[@id=\"resultsDiv\"]/p[1]/a
  </code></pre>
  
  <p>to access the HTML (abbreviated) below:</p>
  
  <pre><code>&lt;p style="margin:0;border-width:0px;"&gt;&lt;a href="./t_Person.aspx?PersonID=140476"&gt;Bill%20Jones&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>The XPath returns this: <code>&lt;a href="./t_Person.aspx?PersonID=140476"&gt;Bill%20Jones&lt;/a&gt;</code></p>
  
  <p>But what I'm trying to get is simply the PersonID = 140476.  </p>
  
  <p><strong>Question</strong>: Is it possible to write an XPath that results in <code>140476</code>, or do I need to take what was returned and use a regular expression other method to access the <code>PersonID</code>.</p>