ALex ALex - 1 year ago 73
HTML Question

If title contains a word that I'm searching I want that scrapy to copy "spec"

<div class="holder-specificatii">

<div class="box-specificatie" id="specifications-93-">
<div class="ch_group"></div>

<p class="ch_title">IPhone:</p>
<p class="ch_spec">iPhone 6</p>
<p class="ch_title">Tip Telefon:</p>
<p class="ch_spec">Smartphone</p>
<p class="ch_title">Sloturi Sim:</p>
<p class="ch_spec">Single Sim</p>
<div class="clear"></div>

Answer Source

If you're looking for a ch_title p that contains (for example) "Tip" and you want to select the next following ch_spec p, use this XPath:


to return:

<p class="ch_spec">Smartphone</p>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download