title: How do I select an empty element in XPath?
body: <p>We select elements with Django 1.4 tests and Selenium like this:</p>
  
  <pre><code>self.assertEqual(1, len(self.selenium.find_elements_by_xpath("//a[@href='#'][@class='button save-as'][@title='Save As...'][text()='Save As']")))
  </code></pre>
  
  <p>(The class inherits from <code>LiveServerTestCase</code>).</p>
  
  <p>The problem is that sometimes there are elements without text, and if we select with <code>[text()='']</code> it fails (the len is 0). How can I select elements without text?</p>
  
  <p><strong>Update</strong>: Because <code>[text()='']</code> didn't work, I had to assert two lines to assert no text:</p>
  
  <pre><code>self.assertEqual(1, len(self.selenium.find_elements_by_xpath("//a[@href='#'][@class='button properties'][@title='Properties']")))
  self.assertEqual("", self.selenium.find_element_by_xpath("//a[@href='#'][@class='button properties'][@title='Properties']").text)
  </code></pre>
  
  <p>Now I can assert the same with one line:</p>
  
  <pre><code>self.assertEqual(1, len(self.selenium.find_elements_by_xpath("//a[@href='#'][@class='button properties'][@title='Properties'][not(text())]")))
  </code></pre>