Чтобы спарсить HTML код, ты можешь использовать класс DOMDocument. Ниже пример: <?php // Send the GET request and store the response as a string $html = file_get_contents('http://www.example.com/'); // Create a new DOMDocument object $dom = new DOMDocument(); // Load the HTML string into the DOMDocument object @$dom->loadHTML($html); // Use DOMXPath to query the DOMDocument object $xpath = new DOMXPath($dom); // Query the DOMDocument object and store the results in an array $elements = $xpath->query("//div[@class='example']"); // Iterate over the array of elements and print the innerHTML of each element foreach ($elements as $element) { echo $element->innerHTML; } PHP <?php // Send the GET request and store the response as a string $html = file_get_contents('http://www.example.com/'); // Create a new DOMDocument object $dom = new DOMDocument(); // Load the HTML string into the DOMDocument object @$dom->loadHTML($html); // Use DOMXPath to query the DOMDocument object $xpath = new DOMXPath($dom); // Query the DOMDocument object and store the results in an array $elements = $xpath->query("//div[@class='example']"); // Iterate over the array of elements and print the innerHTML of each element foreach ($elements as $element) { echo $element->innerHTML; } Этот код отправит запрос GET на указанный URL, спарсит HTML. Затем он выполнит итерацию по массиву элементов и выведет innerHTML каждого элемента.