I have a crawler which crawls a site for a specific value, this value is not directly located inside of a class div but of course has a parent div with is specified by a class.
this value is located in the 3rd div of the parent div (if you look below you will see what i mean).
code
if($page->find('div.mbcContainer div div span')){
foreach($page->find('div.mbcContainer div div span') as $p){
if(trim($p->plaintext)){
$tp = $p->plaintext;
}
}
}
html page
<div class="mbcContainer">
<div>
<div class="ie1"></div>
<div class="ie2"></div>
<div>
<span>get this value</span>
</div>
</div>
</div>
I am trying to get the span with the value “get this value”
is there any way to do this.
Edit:
This does the trick:
Or if you want to iterate through: