I have this HTML, need to grab price
Price is 33.11 (as you probably see).
I try to build regex to get it, no success. I'm totally rubbish with it so got few questions:
1. Should I treat empty spaces between lines in some special way? Like use /n or something to go to the next line?
2. What if the price div is wrapped with <noscript> tag, should it change my approach?
3. I built very simple regex to get price:
It doesn't work of course. I built successful regex for some other pages but stuck with this one.
Any help much appreciated.
Code:
<div class="somediv"> <p class="pricediv">
£33.11 </p>
</div>
Price is 33.11 (as you probably see).
I try to build regex to get it, no success. I'm totally rubbish with it so got few questions:
1. Should I treat empty spaces between lines in some special way? Like use /n or something to go to the next line?
2. What if the price div is wrapped with <noscript> tag, should it change my approach?
3. I built very simple regex to get price:
Code:
$regex = '/.*?<div class="somediv "><p class="pricediv">(.+?)<\/p<\/div>.*?/';
Any help much appreciated.