Парсинг next_page на PHP
Не переходит на следующую страницу для последующего парсинга (перебрасывает на на ту же)
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
include_once('curl_query.php');
include_once('simple_html_dom.php');
set_time_limit(0);
$url = curl_get("https://rezka.ag/films/");
$dom = str_get_html($url);
$films = $dom->find('.b-content__inline_item');
// echo $films ."<br>";
// Находим ссылки пагинации
$next_page_url = $dom->find('.b-navigation a', 0)->href;
echo $next_page_url;
echo "<items>";
echo "<next_page_url>http://34.90.104.32/kinolive/hdrezka2.php?page=$next_page_url</next_page_url>";
foreach($films as $film) {
$title = $film->find('.b-content__inline_item-link', 0)->plaintext;
$title = trim($title);
$odin = $film->find('a', 0)->href;
echo $title ."<br>";
}
echo '</items>';
Подскажите что не так в коде?
Ответы (1 шт):
Автор решения: PRO CODE
→ Ссылка
Надо проводить вот эту операция с новым url(который получили из сайта)
$url = curl_get("новый url");
$dom = str_get_html($url);
$films = $dom->find('.b-content__inline_item');