Estou tentando capturar uma div apartir de sua classe porem nao obtive exito, observe: eu tento capturar a div com a classe class='m-definicao-conteudo'
do site que informo ao curl, porem me retorna esse error:
Warning:
DOMDocument::loadHTML(): Unexpected end tag : a in Entity, line: 102 in /Applications/XAMPP/xamppfiles/htdocs/teste.php on line 13
$ch = curl_init ("");
curl_setopt($ch, CURLOPT_URL, 'http://dicionarioinformal.com.br/aham/');
curl_setopt($ch, CURLOPT_USERAGENT, "Opera/9.80 (J2ME/MIDP; Opera Mini/4.2.14912/870; U; id) Presto/2.4.15");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$html = curl_exec($ch);
$dom = new DOMDocument;
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$results = $xpath->query("//*[@class='m-definicao-conteudo']");
if ($results->length > 0) {
echo $review = $results->item(0)->nodeValue;
}