Here is a same of code I have extracted from a webpage...
<div class="user-details-narrow">
<div class="profileheadtitle">
<span class=" headline txtBlue size15">
Profession
</span>
</div>
<div class="profileheadcontent-narrow">
<span class="txtGrey size15">
administration
</span>
</div>
</div>
<div class="user-details-narrow">
<div class="profileheadtitle">
<span class=" headline txtBlue size15">
Industry
</span>
</div>
<div class="profileheadcontent-narrow">
<span class="txtGrey size15">
banking
</span>
</div>
</div>
What I want to achieve is to extract the data within those DIVs. For example...
Profession = administrator Industry = bank
Currently I am pulling the webpage with Curl, then stripping out the html tags, and using hundreds of preg_match and if functions. While the solution works very well, it does use a lot of cpu and ram.
It has been suggested I use DOMDocument instead but I can't seem to get anything to work, mostly due to lack of knowledge.
Can someone give me a idea how to extract this data?