I wanted to get help with getting the contents of a page by the class, ie, to get all the html inside a div whose class is equal to the one informed.
Below is what I have been able to do so far.
$curl = curl_init();
$curl_setopt($curl, CURLOPT_URL, 'https://www.flickr.com/photos/esprit-confus/albums');
$curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 60);
$html = curl_exec($curl);
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML($html);
libxml_clear_errors();
$xpath = new DOMXPath($dom);
$albunsDiv = $xpath->query('//div[@class="view photo-list-view requiredToShowOnServer"]')->item(0);
echo $album = $dom->saveXML($albunsDiv);