News for hackers. Stuff that matters.
Re:Show HN: Nightmare – Simple browser automation by dutzi_ on Tuesday October 07, 2014 @08:43AM (#8420770)
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();
Re:Show HN: Nightmare – Simple browser automation by pkrein on Tuesday October 07, 2014 @09:48AM (#8421040)
extracting stuff seems to be a common use case so added an example to the readme for ya: https://github.com/segmentio/nightmare#examples