title: Scrapy Python xpath for <mark>
body: <p>I would like to extract with scrapy some information contained on  tags with .xpath or .css on Scrapy.</p>
  
  <p>But I want to put some condition and I have no idea how to that.
  For example, let's see this HTML code of the webpage that I want to scrap.</p>
  
  <pre><code>&lt;div data-tabs-content="" class="estateTabs-panels"&gt;
    &lt;div id="detail" data-tabs-pane="" class="estateTabs-panel active"&gt;
     &lt;ul class="dotted-list dotted-list--ocom"&gt;
      &lt;li&gt;&lt;mark&gt;Nombre de pièce(s)
       &lt;/mark&gt; &lt;mark&gt;3&lt;/mark&gt;
      &lt;/li&gt;
      &lt;li&gt;
      &lt;li&gt;&lt;mark&gt;Nombre de chambre(s)&lt;/mark&gt;
      &lt;mark&gt;2&lt;/mark&gt;
      &lt;/li&gt;                              
      &lt;li&gt; 
      &lt;mark&gt;Surface&lt;/mark&gt;
      &lt;li&gt;&lt;mark&gt;70.68m²&lt;/mark&gt;
      &lt;/li&gt;
  </code></pre>
  
  <p>My problem is for each page of the website, values inside <code>&lt;mark&gt;</code> tag are different and I want to extract, for example,  for <code>&lt;mark&gt;2&lt;/mark&gt;</code> the value 2 if the previous mark tag contains "Nombre de chambre(s)".</p>
  
  <p>For example, I wanted to do something like this:</p>
  
  <pre><code>if elt.css(".XXXX").extract_first() == ' Nombre de chambre(s) ':
         item['value'] = elt.css(".XXXX").extract_first() 
  </code></pre>
  
  <p>and the result must be 2</p>
  
  <p>For the moment I can just scrap with this way:</p>
  
  <pre><code>item['value'] = info.css('.estateTabs-panel ::text').extract()[4]
  </code></pre>
  
  <p>but I don't want to use <code>[int]</code> because for each page the values are different.</p>
  
  <p>Is it possible with mark tag?</p>