title: scrapy get parent element
body: <p>I'm new to scrapy and need to do one thing. I used to use lxml and did</p>
  
  <pre><code>elements = careers.xpath('//text()[contains(., "engineer")')
  </code></pre>
  
  <p>After that I was able to do </p>
  
  <pre><code>element = elements[0].getparent()
  </code></pre>
  
  <p>Unfortunately, I can't do the same with <code>scrapy</code>. </p>
  
  <p>I try doing </p>
  
  <pre><code>response.xpath('//text()[contains(., "engineer")') 
  </code></pre>
  
  <p>as well as <code>.getparent()</code> from any of these elements, but it says that Selectors have no attribute <code>getparent</code>. Is it possible to do the same with <code>scrapy</code>? </p>