0
wanted a help to pick up the contents of a page by class, ie, take all the html inside a div whose class is equal to the informed.
Below is what I have managed 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);
At first I don’t know if their website allows this type of content capture, I advise reading the Flickr API documentation: https://www.flickr.com/services/api/
– RpgBoss