title: Relative XPath in scrapy selector
body: <p>I'm trying to extract the information in the table "Comissões a que pertence / pertenceu" from <a href="http://www.parlamento.pt/DeputadoGP/Paginas/ActividadeDeputado.aspx?BID=4057&amp;lg=XIII" rel="nofollow noreferrer">here</a> using Scrapy. </p>
  
  <p>Since the number of tables can change (and I want to extract the information for several equivalent pages), I first find the relevant section with</p>
  
  <pre><code>for node in response.xpath('//*[@class = "ARLabel TextBold"]'):
      texto = node.extract()
      if u'Comissões a que pertence' in texto:
          break
  </code></pre>
  
  <p>and then I was trying to find the part of the needed info through:</p>
  
  <pre><code>node.xpath('.//*[@class = "ARTabResultadosLinhaImpar"]')
  </code></pre>
  
  <p>but results in an empty list.</p>
  
  <p>EDIT: removed /text()</p>
  
  <p><strong>EDIT2:</strong> I solved the problem with a single xpath:</p>
  
  <pre><code>response.xpath(u"//*[@class = 'ARLabel TextBold' and contains(text(), 'Comissões a que pertence')]/following-sibling::*//span/text()").extract()
  </code></pre>