title: Selenium / lxml : Get xpath
body: <p>Is there a <code>get_xpath</code> method or a way to accomplish something similar in selenium or lxml.html. I have a feeling that I have seen somewhere but can't find anything like that in the docs.</p>
  
  <p>Pseudocode to illustrate:</p>
  
  <pre><code>browser.find_element_by_name('search[1]').get_xpath()
  
  &gt;&gt;&gt; '//*[@id="langsAndSearch"]/div[1]/form/input[1]'
  </code></pre>