The site i need to scrape is having structure like
<span class="address">
<p>...</p>
<h4>...</h4>
....
</span>
All i need is html inside of
<span class="address"></span>
What i am using is a code from google.
$html = new DOMDocument();
@$html->loadHtmlFile('www.site.com');
$xpath = new DOMXPath( $html );
$nodelist = $xpath->query( '//*[@id="main_center"]/div/div/div[2]/div/span[15]/p[6]' );
foreach ($nodelist as $n){
echo $n->nodeValue."\n";
}
Its only giving me content without html,i need have all html so that i can filter them according to my needs.
Please provide suggestion, Thank you.