I have an html like
Dr. Maria Steffens
Institute of Medico
Sta. Ana, strt PH-501
1062 Caracas
France
Telefon: +58-457-2889567
Now i want to separate every tag like
Dr. Maria Steffens
or occurrence of
tag
I have tried
$html = new DOMDocument();
@$html->loadHtmlFile('http://www.sitetofetch.com');
$xpath = new DOMXPath( $html );
$nodelist = $xpath->query( "//*[@class='address']" );
foreach ($nodelist as $n){
$newhtml = $html->saveHtml($n)."\n";
$newhtml = htmlentities($newhtml);
$items = $html->getElementsByTagName('h1');
}
but its not working properly,
How can i do that.
No comments:
Post a Comment