Slimer Js webpage evaluation

时间:2016-06-18 20:11:24

标签: slimerjs

var webpage = require('webpage').create();

webpage
  .open('http://example.com')
  .then(function(){
    var someContent = webpage.evaluate(function () {
        return document.querySelector("#aDiv").textContent;
    });

     console.log(someContent);
  });

It is called once, but my web page is dynamically changing. How can I intercept every change?

1 个答案:

答案 0 :(得分:0)

如果由于ajax调用而改变,你应该使用onResourceReceived来观察变化