Javascript - Nightmare.JS infinite scroll action
问题 What am I doing wrong here? I want to scroll-down a page until the selector is gone. Nightmare.action('scrollPage', function (done) { this.evaluate_now(function () { var hitRockBottom = false; while (!hitRockBottom) { // console.log("1"); // Scroll the page (not sure if this is the best way to do so...) this.scrollTo(100000, 0); // Check if we've hit the bottom hitRockBottom = this.evaluate(function() { // console.log("0"); return this.exists('selector') === null; }); } }, done) }) I'm using: