I have to get the location of a number from this site
lookupexpert.com/search_phone?phone_number=7322691678
And i want a regex that matches anything inside
<p class="location">OCEAN GATE, NJ</p>
How do i do that?
This is what i did so far
<?php
$subject = file_get_contents("http://lookupexpert.com/search_phone?phone_number=7322691678");
$pattern = '#\<p class="location"\>(.+?)\<\/p\>#s';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?>
and also ... i tried with Xpath, and didn't worked so good, because it is not properly validated
/html/body/div/div[2]/div/ul/li[2]/p[4]