I have a unique item on an html page. I have been able to parse most of the items, since they are not using combined processed to parse one item.
I have a tricky item to parse:
- it is a list item, inside a DIV, which is unique (ld_sec_col)
- the UL class is not unique (ld_details_list)
- it is NOT a specific list item number (e.g. not the 3rd or 4th, that) always changes
- it IS found after unique text
- my problem is combining the techniques used to get it, without an error, and i am braindead.
Here is the snippet:
#####
<div class="ld_sec_col">
<ul class="ld_details_list">
<li><span class="ld_lbl">Exterior:</span> Brick</li>
<li><span class="ld_lbl">Living style:</span> Bungalow</li>
<li><span class="ld_lbl">Property type:</span> Detached</li>
<li><span class="ld_lbl">Sewer system:</span> Sewers</li> </ul>
</div>
### End Snippet ###
So here I am trying to locate the unique text, (Property type:) and grab the text immediately following it:
I am obviously misusing FIND. And I am reduced to trial and error. But I would like to have this script done before Christmas. It is the last item....
### START PHP CODE ###
$tempproptype = trim($entry->find('.ld_sec_col', 0)->plaintext);
if(preg_match('/^Property type: (.*),/', $tempproptype, $matches))
$propertytype = $matches[1];
### ENDPHP CODE ###