Answer the question
In order to leave comments, you need to log in
How to make an xpath query from the requested result?
Here is my code
$content = curl_exec($ch);
curl_close($ch);
$domDocument = new DOMDocument();
@$domDocument->loadHTML($content);
$xPath = new DOMXPath($domDocument);
$pElement = $xPath->query('/html/body/section/div/div');
foreach($pElement as $element){
echo $domDocument->saveHTML($element);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question