I want to collect all the information from a specific category with one call to Phantomjs (walk through page-by-page navigation, switching between pages). The fact is that when the site is clicked on the page number / arrow, the target block changes with the information and the URL of the page via ajax, i.e. page overload does not occur. Phantomjs does not understand this and continues to take information from the initially loaded page.
The option to run page.open several times with a URL change is not very good, it will take too long to load and the load will be too large.
Sample code:
page.open(url, function (status) { var data = page.evaluate(function() { //Пока стрелка вправо активна, нажимаем на неё while ($('.arrow_right').hasClass('disabled') === false) { //Логика сбора данных //Нажимаем на стрелку var ev = document.createEvent("MouseEvents"); ev.initEvent("click", true, true); document.querySelector('.arrow_right').dispatchEvent(ev); //Так подозреваю, что здесь что-то надо сделать для обновления данных } }); console.log(data); phantom.exit(); }); Type link site.ru/category/page/1/
Tell me, is there such an opportunity at all or not?