I need to get the content from an atribute inside a tag name a named data-copy.
This is the the non working code I got so far...
libxml_use_internal_errors(true);
$html=file_get_contents('https://mypage.com/');
$dom = new DOMDocument;
$dom->loadHTML($html);
foreach(
$dom->getElementsByTagName('a') as $thetag){
if($thetag->getAttribute('a')=="data-copy"){echo "<h6>".$thetag->nodeValue."</h6>";}
}