how to scrape html content of div using all matched class
<p>The site i need to scrape is having structure like</p>

<pre><code>&lt;span class="address"&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;h4&gt;...&lt;/h4&gt;
....
&lt;/span&gt;
</code></pre>

<p>All i need is html inside of</p>

<pre><code>&lt;span class="address"&gt;&lt;/span&gt;
</code></pre>

<p>What i am using is a code from google.</p>

<pre><code>$html = new DOMDocument();
@$html-&gt;loadHtmlFile('www.site.com');
$xpath = new DOMXPath( $html );
$nodelist = $xpath-&gt;query( '//*[@id="main_center"]/div/div/div[2]/div/span[15]/p[6]' );

foreach ($nodelist as $n){
 echo $n-&gt;nodeValue."\n";
}
</code></pre>

<p>Its only giving me content without html,i need have all html so that i can filter them according to my needs.</p>

<p>Please provide suggestion,
Thank you.</p>