title: Nokogiri Xpath to retrieve text after <BR> within <TD> and <SPAN>
body: <p>I have the following html and like to know how to use xpath to retrieve all the info:
  - Name(first, last)
  - Nick Name
  - email
  - shipping address...</p>
  
  <p>Primarily, retrieve text after <code>&lt;BR&gt;</code>. Many Thanks in advance.</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
  &lt;td valign="top" width="50%" align="left"&gt;
  &lt;span&gt;Buyer&lt;/span&gt;&lt;br/&gt;FirstName LastName&lt;br/&gt;NickName&lt;br/&gt;First.Last@SomeCompany.com&lt;/td&gt;
  
  &lt;tr&gt;&lt;td valign="top" width="40%" align="left"&gt;
  &lt;span&gt;&lt;span&gt;Shipping address - &lt;/span&gt;&lt;span&gt;confirmed&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;FirstName LastName&lt;br/&gt;Attn: FirstName&lt;br/&gt;1234 Main St.&lt;br/&gt;TheCity, TheState, 12345&lt;br/&gt;United States&lt;br/&gt;&lt;/td&gt;
  &lt;/tr&gt;&lt;/table&gt;
  </code></pre>
  
  <p>After I posted the above question, I learned that I can do these, but does not look clean:</p>
  
  <pre><code>buyer = html.xpath("//span/text()[contains(., 'Buyer')]").first.parent 
  buyer_name = buyer.next.next 
  puts "Buyer's Full name: #{buyer_name.text}" 
  buyer_nick = buyer_name.next.next 
  puts "Buyer's Nick name: #{buyer_nick.text}" 
  buyer_email = buyer_nick.next.next 
  puts "Buyer's email: #{buyer_email.text}" 
  </code></pre>
  
  <p>My question now is why the html.xpath("//span/text()[contains(., 'Buyer')]") return the TEXT itself instead of the ELEMENT. Again, thanks!!</p>