Answer the question
In order to leave comments, you need to log in
How to embed asynchronous code in a page using PhantomJs?
Using page.open() I open the page at the address, then I need to embed the code that:
1) will click on the button.
2) Wait until the new DOM elements of the site are loaded (well, or at least until the specified number of seconds pass)
3) Then work with these elements.
I embed the code on the page using page.evaluate
Here is my sample code:
page.open(url, function(status) {
var elements_array = page.evaluate(function() {
1)находим элемент кнопки()
2)генерируем событие нажатия()
3)ждем подгрузки()
4)собираем нужную информацию с элементов по селекторам()
return elements_array;
});
console.log(elements_array);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question