Back to front pageView on Hacker News (opens in a new tab)Show HN: Nightmare – Simple browser automation (opens in a new tab)nightmarejs.org429 pointsby pkrein (on Hacker News)12 years agonightmarejs.org (opens in a new tab)Registered & Protected by MarkmonitorComments (70) 33 threadsShow all commentsShowing thread 17 of 33[-]dutzi_12 years ago1 reply#Nice work!Can you please provide an example for using `evaluate()` to get the page's content?I tried this, but didn't get anything: new Nightmare() .goto('http://yahoo.com') .evaluate(function (page) { return this.content; }, function (res) {console.log(res);}) .run();pkrein12 years ago#extracting stuff seems to be a common use case so added an example to the readme for ya: https://github.com/segmentio/nightmare#examples
Show HN: Nightmare – Simple browser automation (opens in a new tab)nightmarejs.org429 pointsby pkrein (on Hacker News)12 years ago
dutzi_12 years ago1 reply#Nice work!Can you please provide an example for using `evaluate()` to get the page's content?I tried this, but didn't get anything: new Nightmare() .goto('http://yahoo.com') .evaluate(function (page) { return this.content; }, function (res) {console.log(res);}) .run();
pkrein12 years ago#extracting stuff seems to be a common use case so added an example to the readme for ya: https://github.com/segmentio/nightmare#examples
Comments (70) 33 threads
Show all comments
Showing thread 17 of 33
Can you please provide an example for using `evaluate()` to get the page's content?
I tried this, but didn't get anything: