var webpage = require('webpage').create(); webpage .open('http://example.com') .then(function(){ var someContent = webpage.evaluate(function () { [может CALLBACK?] return document.querySelector("#aDiv").textContent; }); }); 

SlimerJS. Connects to the page. The call takes place once. But the page continues to change dynamically. How to implement a constant interception of this event?

    1 answer 1

    There are 2 options:

    1 put on settimeout

    2 compare the received answer from the previous one, if they are different, then output the received answer; if they are the same, output the previous one.

    • # 2 is what you need! But for me this construction works only once. How can I attach a callback function there that will work every time the page changes? - dnikitin