title: Xpath get element above
body: <p>suppose I have this structure:</p>
  
  <pre><code>&lt;div class="a" attribute="foo"&gt;
      &lt;div class="b"&gt;
          &lt;span&gt;Text Example&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In xpath, I would like to retrieve the value of the attribute "attribute" given I have the text inside: Text Example</p>
  
  <p>If I use this xpath:</p>
  
  <pre><code>.//*[@class='a']//*[text()='Text Example']
  </code></pre>
  
  <p>It returns the element span, but I need the div.a, because I need to get the value of the attribute through Selenium WebDriver</p>